for-win icon indicating copy to clipboard operation
for-win copied to clipboard

com.docker.backend.exe takes all RAM over time and crashes the host PC

Open Maaarkie opened this issue 1 year ago • 17 comments

Description

I'm running a total of 10 Windows-based containers. These containers must be Windows-based, since we have some legacy applications that we need to communicate with. However, I've noticed that the com.docker.backend.exe process is consuming a lot of RAM over time. Eventually this will cause the PC to run very slow and it will crash the PC. Here some screenshots with dates and the belonging memory consumption:

08 okt. 2024: Image

14 okt. 2024: Image

16 okt 2024: Image

As you can see, the memory usage increased from a couple of MBs to 1017.6 MB!

I tried some suggestions that were suggested here .

I tried installing the latest version of Docker Desktop (4.34.2 at that time).

I tried to allocate a maximum amount of RAM with the .wslconfig :

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

However I believe this has no use, because I'm running Windows-based containers.

I also tried to turn off SBOM indexing and Enable background SBOM indexing, but the problem still persists.

When restarting the PC, the memory consumption will be back to normal, however this is not a solution for me. The containers must always be running, there is no possibility to restart the PC once in a while.

Reproduce

  1. Startup docker desktop
  2. Create 10 Windows-based containers
  3. Wait some days/a week and check the RAM usage

Expected behavior

Process com.docker.backend.exe should not increase RAM usage over time.

docker version

Client: Version: 27.2.0 API version: 1.47 Go version: go1.21.13 Git commit: 3ab4256 Built: Tue Aug 27 14:17:17 2024 OS/Arch: windows/amd64 Context: desktop-windows

Server: Docker Desktop 4.34.2 (167172) Engine: Version: 27.2.0 API version: 1.47 (minimum version 1.24) Go version: go1.21.13 Git commit: 3ab5c7d Built: Tue Aug 27 14:16:14 2024 OS/Arch: windows/amd64 Experimental: false

docker info

Client: Version: 27.2.0 Context: desktop-windows Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.16.2-desktop.1 Path: C:\Program Files\Docker\cli-plugins\docker-buildx.exe compose: Docker Compose (Docker Inc.) Version: v2.29.2-desktop.2 Path: C:\Program Files\Docker\cli-plugins\docker-compose.exe debug: Get a shell into any image or container (Docker Inc.) Version: 0.0.34 Path: C:\Program Files\Docker\cli-plugins\docker-debug.exe desktop: Docker Desktop commands (Alpha) (Docker Inc.) Version: v0.0.15 Path: C:\Program Files\Docker\cli-plugins\docker-desktop.exe dev: Docker Dev Environments (Docker Inc.) Version: v0.1.2 Path: C:\Program Files\Docker\cli-plugins\docker-dev.exe extension: Manages Docker extensions (Docker Inc.) Version: v0.2.25 Path: C:\Program Files\Docker\cli-plugins\docker-extension.exe feedback: Provide feedback, right in your terminal! (Docker Inc.) Version: v1.0.5 Path: C:\Program Files\Docker\cli-plugins\docker-feedback.exe init: Creates Docker-related starter files for your project (Docker Inc.) Version: v1.3.0 Path: C:\Program Files\Docker\cli-plugins\docker-init.exe sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.) Version: 0.6.0 Path: C:\Program Files\Docker\cli-plugins\docker-sbom.exe scout: Docker Scout (Docker Inc.) Version: v1.13.0 Path: C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server: Containers: 11 Running: 11 Paused: 0 Stopped: 0 Images: 97 Server Version: 27.2.0 Storage Driver: windowsfilter Windows: Logging Driver: json-file Plugins: Volume: local Network: ics internal l2bridge l2tunnel nat null overlay private transparent Log: awslogs etwlogs fluentd gcplogs gelf json-file local splunk syslog Swarm: inactive Default Isolation: hyperv Kernel Version: 10.0 19044 (19041.1.amd64fre.vb_release.191206-1406) Operating System: Microsoft Windows Version 21H2 (OS Build 19044.3570) OSType: windows Architecture: x86_64 CPUs: 4 Total Memory: 15.93GiB Name: DESKTOP-9S3SET8 ID: 32d73d12-bff4-47e7-8717-a203fdc2f85d Docker Root Dir: C:\ProgramData\Docker Debug Mode: false Labels: com.docker.desktop.address=npipe://\.\pipe\docker_cli Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Product License: Community Engine

Diagnostics ID

7969AA87-6917-4BC1-938D-A514E6CC509C/20241016065516

Additional Info

No response

Maaarkie avatar Oct 16 '24 07:10 Maaarkie

Have the same issue, after a few days, possibly after sleep/suspend cycle, possibly connected to activating systemd in my main docker container with Ubuntu 22.04.3 LTS ?

cat /etc/wsl.conf
[network]
generateHosts=false
generateResolvConf=false

[boot]
#systemd=true

br1sc avatar Oct 18 '24 07:10 br1sc

I don't think this is related, since I am running Windows-based containers.

Maaarkie avatar Oct 18 '24 07:10 Maaarkie

I have the same problem as far as I can see. I am forced to run windows containers due to third party libraries I depend upon. However, I need to restart docker desktop once in a while (and therefore shut down the whole application, which is quite a problem for my customer!) due to the fact that RAM consumption on the host where docker desktop runs is maxed out.

I also tried the same things described in the issue above and was about to create an issue when I ran into this one.

jdjong avatar Oct 25 '24 11:10 jdjong

Have the same issue: com.docker.backend.exe grows in memory indefinitely over time. In my case Linux containers over wsl2 are used. Docker desktop for windows v4.35.0. I have script that auto restarts Docker in a case of process RAM cap is reached, here are the stats from its' logs: v4.35.0: [11/02/2024 08:35:05.051] Docker process [com.docker.backend] RAM size is too big. Max allowed size [5]GB, current size [6.43]GB [11/02/2024 08:35:05.056] Docker process uptime: [87.75]Hours [10/29/2024 16:50:04.786] Docker process [com.docker.backend] RAM size is too big. Max allowed size [4]GB, current size [4.81]GB [10/29/2024 16:50:04.791] Docker process uptime: [88]Hours v4.32.0: [10/19/2024 07:25:04.947] Docker process [com.docker.backend] RAM size is too big. Max allowed size [4]GB, current size [4.97]GB [10/19/2024 07:25:04.952] Docker process uptime: [176.39]Hours [10/10/2024 23:00:04.952] Docker process [com.docker.backend] RAM size is too big. Max allowed size [4]GB, current size [4.91]GB [10/10/2024 23:00:04.957] Docker process uptime: [174.5]Hours

There was an issue even with v4.32.0, but it became much worse with v4.35.0.

igorewka avatar Nov 02 '24 13:11 igorewka

We're encountering the same problem: the need to reboot our system every few weeks due to the backend service's memory usage constantly increasing.

Auto-restarting isn't applicable for us, as suggested by @igorewka, because our automation systems require uninterrupted operation to monitor triggers from field devices. A restart would halt our production line.

This has been an ongoing issue for over a year now, ever since I began using Docker Desktop. With each new release, I hope for a resolution, but it remains unsolved.

Attempts to modify .wslconfig have also been unsuccessful, with no noticeable change in behavior. It's a frustrating issue, especially given the extensive time required to verify the behavior.

jdvmanen avatar Nov 05 '24 13:11 jdvmanen

I am using Docker Desktop 4.35.1 and face the same issue with increasing memory. It is very frustrating to see many have similar issue and no fix is found by the docker support.

josephlx avatar Nov 12 '24 11:11 josephlx

Hi Docker team,

Will this issue be resolved soon? Knowing the timeline would help us decide the best route for our deployment strategy. There are multiple reports for this problem, but I have not been able to find a solution yet: Reported issue 1 Reported issue 2 Reported issue 3

It is very frustrating that the PC crashes every few days due to this issue. Any updates or guidance would be greatly appreciated! Thanks

Maaarkie avatar Nov 15 '24 12:11 Maaarkie

Hi Docker team,

Will this issue be resolved soon? Knowing the timeline would help us decide the best route for our deployment strategy. There are multiple reports for this problem, but I have not been able to find a solution yet: Reported issue 1 Reported issue 2 Reported issue 3

It is very frustrating that the PC crashes every few days due to this issue. Any updates or guidance would be greatly appreciated! Thanks

Also waiting for a status update on this. Just an idea about when there will be looked at this issue would already help. Thank you in advance.

jdjong avatar Nov 25 '24 08:11 jdjong

Have the same issue: com.docker.backend.exe grows in memory indefinitely over time. In my case Linux containers over wsl2 are used. Docker desktop for windows v4.35.0. I have script that auto restarts Docker in a case of process RAM cap is reached, here are the stats from its' logs: v4.35.0: [11/02/2024 08:35:05.051] Docker process [com.docker.backend] RAM size is too big. Max allowed size [5]GB, current size [6.43]GB [11/02/2024 08:35:05.056] Docker process uptime: [87.75]Hours [10/29/2024 16:50:04.786] Docker process [com.docker.backend] RAM size is too big. Max allowed size [4]GB, current size [4.81]GB [10/29/2024 16:50:04.791] Docker process uptime: [88]Hours v4.32.0: [10/19/2024 07:25:04.947] Docker process [com.docker.backend] RAM size is too big. Max allowed size [4]GB, current size [4.97]GB [10/19/2024 07:25:04.952] Docker process uptime: [176.39]Hours [10/10/2024 23:00:04.952] Docker process [com.docker.backend] RAM size is too big. Max allowed size [4]GB, current size [4.91]GB [10/10/2024 23:00:04.957] Docker process uptime: [174.5]Hours

There was an issue even with v4.32.0, but it became much worse with v4.35.0.

The same issue with v4.36.0: [12/07/2024 22:50:04.648] Docker process [com.docker.backend] RAM size is too big. Max allowed size [7]GB, current size [7.74]GB [12/07/2024 22:50:04.665] Docker process uptime: [176.66]Hours

igorewka avatar Dec 08 '24 18:12 igorewka

This is taking way too much time... I run windows containers, so followed those instructions for Windows containers to install Docker without Docker Desktop. To have the management functions provided by Docker Desktop I use still available, I run a portainer community edition container for my Docker for Windows standalone installation.

I do not use Docker Desktop anymore and am free of this issues problem.

jdjong avatar Dec 11 '24 08:12 jdjong

The same issue with v4.37.0. Don't understand the silence from the Docker team. Could you, please, explain why do you think this is not an issue to be investigated and fixed?

igorewka avatar Dec 20 '24 09:12 igorewka

This problem has been bothering me for two years....

YANANEER avatar Dec 26 '24 20:12 YANANEER

Current issue looks very similar to https://github.com/docker/for-win/issues/13589

igorewka avatar Dec 29 '24 20:12 igorewka

The same issue with v4.38.0. Maybe someone will fix it someday...

Descryuk avatar Feb 22 '25 12:02 Descryuk

I wouldn't have too much hope. It seems like they don't give a damn about this issue. In the end, I followed the solution of @jdjong . I'm using portainer for the container administration now. Docker Desktop is a shit application with memory leaks for as long as I've been using it and I don't expect it to be fixed anytime soon. Don't place your bet on Docker Desktop, start using portainer or an alternative container manager.

Maaarkie avatar Feb 24 '25 07:02 Maaarkie

I have the same issue. on v4.38 and v4.37 Image

I think is related with builds. When i delete the older builds, the used memory reduced.

juanmanueldomt avatar Feb 26 '25 17:02 juanmanueldomt

I followed the solution of @jdjong and @Maaarkie as well. So long docker desktop. Pure docker is so much better in wsl! Thank you!

igorewka avatar Mar 12 '25 11:03 igorewka

I'm facing same issues CPU and RAM both is used 98%

Image

When I closed and remove all active container CPU and RAM still high

Image

I use WSL memory limit = 6GB for 4 months didn't have this issue, but today I set limit to 16GB, then this issue occur.

chris0203 avatar Apr 08 '25 07:04 chris0203

Experienced the same on my server. Eats up all the memory and then is it's depleted the system swap is coming that's why the high usage of disks also. And if you are not near to the server and notice it after days, it could be really annoying your machine does not respond to anything.

Temporary solution - I hope so - rollbacked to v4.29 because I felt someting update came into the v4.3X versions that are beared by the v4.40 and the latest docker desktops. Right nnow I don't experience any high memory and disk consumptions. Docker Desktop Backend works with only 150-180 MB of RAM.

vgary06 avatar Aug 11 '25 10:08 vgary06

same issue with CPU and RAM usage I have reinstall windows, install latest docker version and now I am can't work (same system, same hardware as before).

1 running container ~150 mb com.docker.backend.exe high CPU and RAM usage

Widows 10 Docker v4.43.2

gbviktor avatar Aug 12 '25 22:08 gbviktor

Same issue. Windows 11.

I'm running all Linux-based containers. Over the course of a day, docker desktop backend consumes over half my system RAM.

amgiunta avatar Oct 22 '25 21:10 amgiunta