GlobalMemoryStatusEx ignores memory restrictions in Windows Server Container RRS feed

  • Question

  • I am running microsoft/nanoserver image on win2016 with Docker restricting container memory to 512MB:

    docker run -m 512m ...

    Inside the container GlobalMemoryStatusEx returns the amount of available RAM (ullAvailPhys) as 3GB, but malloc for 1024M (expectedly) fails.

    Hi can I find out the available RAM inside the container?

    PS: on linux such info is available inside the container in /sys/fs/cgroup/memory/memory.limit_in_bytes

    Saturday, January 14, 2017 3:37 PM