Mazen Sharkawy
Mazen Sharkawy

Reputation: 439

Starting Docker for windows takes so much ram even without running a container How to prevent it?

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

Answers (2)

Prashanth Wagle
Prashanth Wagle

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

bolec_kolec
bolec_kolec

Reputation: 510

You can change it in settings. Just decrease memory usage by the slider. Go to settings and choose the Advanced tab. enter image description here other settings: https://docs.docker.com/docker-for-windows/#docker-settings-dialog

Upvotes: 6

Related Questions