How docker allocate memory to the process in container?
Docker first initializes a container and then execute the program you want. I wonder how docker manages the memory address of container and the program in it.
Docker does not allocate memory, it's the OS that manages the resources used by programs. Docker (internally) uses cgroups which is a kernel service. The reason that
pscommand (on the host) won't show up processes running in a container, is that containers run in different
cgroupswhich are isolated from each other.
Rather than worrying about the docker memory, you would need to look at the underlying host (VM/instance) where you are running the docker container. The number of containers is determined by a number of factors including what your app is that runs on the container. See here for the limits that you can run into Is there a maximum number of containers running on a Docker host?