Reputation: 439
When I start docker for windows memory usage increases by almost 25% of 6 GB (that's 1.5 GB) without even running a container. I can't see the docker process that in the task manager, but I figured the memory usage by looking at the memory usages % before and after running the docker for windows program. I'm running windows 10. How can I prevent docker from eating up all this ram.
Upvotes: 3
Views: 5647
Reputation: 364
The solution is to create a .wslconfig
file in the Windows home directory (C:\Users\<Your Account Name>
).
Input the contents of the file as follows:-
[wsl2]
memory=1GB
processors=1
The memory and processors are the resources allocated to the wsl2 process. You can change the memory and processors according to your preference. This is my config on a 16GB i5 machine.
After that, restart the WSL2 process:-
Start PowerShell in admin mode and type: Restart-Service LxssManager
After that, you are good to go!
P.s.: Start docker only when it is required.
Upvotes: 5
Reputation: 510
You can change it in settings. Just decrease memory usage by the slider. Go to settings and choose the Advanced tab.
other settings:
https://docs.docker.com/docker-for-windows/#docker-settings-dialog
Upvotes: 6