Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker desktop eats all memory and crashes

Using Docker Desktop (19.03.13) with 6 containers in Windows 10. Having 16GB RAM.

In docker stats each container consumes 20-500 mb, all together cunsume ~1gb.

But in the Task Manager docker eats ~10gb and crashes from the lack of system memory.

How to check, what consumes so much memory in docker? And how to prevent this?

like image 948
kostepanych Avatar asked Oct 30 '20 16:10

kostepanych


People also ask

How to stop desktop Docker from crashing?

run your desktop docker it is probably working now with no crashes and exceptions. Show activity on this post. Click on the Start button 2)Then type services 3)search for Docker Desktop Services. 4)click on that 5)on the top left click on stop service and then click on start service.

How much RAM does Docker use in Windows 10?

Using Docker Desktop (19.03.13) with 6 containers in Windows 10. Having 16GB RAM. In docker stats each container consumes 20-500 mb, all together cunsume ~1gb. But in the Task Manager docker eats ~10gb and crashes from the lack of system memory.

Why can't I use Docker on Windows?

Sorry, something went wrong. The short answer is docker for windows is terrible for Linux containers so don't use it. Switch to Linux OS if you want Linux docker. Sorry, something went wrong. I added more memory resources to docker service (in settings -> advanced) and it solved my problem.

How do I increase the processing power of Docker?

By default, Docker Desktop is set to use half the number of processors available on the host machine. To increase processing power, set this to a higher number; to decrease, lower the number. Memory. By default, Docker Desktop is set to use 2 GB of your host’s memory.


2 Answers

Try to create a .wslconfig file at the root of your User folder C:\Users\<my-user> to adjust how much memory & processors Docker will use.

This is the content of the .wslconfig file.

[wsl2]
memory=2GB   # Limits VM memory in WSL 2 up to 2GB
processors=2# Makes the WSL 2 VM use two virtual processors

Then, restart the computer. You will find the Vemm process will only take the amount of RAM you defined previously.

You can learn more here here

like image 135
Leo Avatar answered Nov 10 '22 02:11

Leo


I guess you are using the new WSL 2 based engine, try switching docker engine back to Hyper-V by going opening docker settings -> general -> uncheck Use WSL 2 based Engine .

To explain:

I noticed it started happening to me since WSL 2 engine was introduced, i automatically switched to it since it's a new engine; Memory issues started arising since then.

Restarting/closing docker did not free the memory and i noticed in task Manager Vemm was the one eating all memory, so had to force close it (caused docker not to work).

Last thing i did was switching docker engine back to Hyper-V solved my high memory usage.

like image 45
Abdulaziz Hamdan Avatar answered Nov 10 '22 03:11

Abdulaziz Hamdan