Docker windows container memory limit
According to talks on Docker for windows Github issues (https://github.com/moby/moby/issues/31604), when Docker for Windows is run under Windows 10, it is actually using a Hyper-V isolation model (and process model is not accessible in Win 10 scenario).
And in that isolation type, your container is run inside a lightweight VM, which DOES have a default limit, and it is 1 Gb. So if you want to have more memory you should use -m param.
If using a Linux container
For me, on Windows 10 using Docker Desktop, I could not get the --memory=
and --cpus=
options to work. Here's what does work:
- Right click on the Docker whale in the system tray and choose "Settings"
- Go to "Advanced" on the left
- Set how many CPUs and memory is available to containers here.
Surprise! Surprise!
I have 32Gb RAM on my host but I can see only 1Gb RAM given to Windows containers:
D:\>systeminfo | findstr "Memory"Total Physical Memory: 1,023 MBAvailable Physical Memory: 634 MBVirtual Memory: Max Size: 1,023 MBVirtual Memory: Available: 674 MBVirtual Memory: In Use: 349 MBD:\>wmic OS get FreePhysicalMemory /ValueFreePhysicalMemory=648340D:\>wmic computersystem get TotalPhysicalMemoryTotalPhysicalMemory1072742400
The same limit on images made from:
- microsoft/windowsservercore
- microsoft/nanoserver
I think it's coming from the Hyper-V layer in --isolation=hyperv
mode, where a container is some sort of lightweight VM.
You can check isolation mode used for your existing container by docker inspect
command.