docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.87k stars 291 forks source link

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

Open Maaarkie opened 1 month ago

Maaarkie commented 1 month ago

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

br1sc commented 1 month ago

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
Maaarkie commented 1 month ago

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

jdjong commented 4 weeks ago

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.

igorewka commented 3 weeks ago

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.

jdvmanen commented 2 weeks ago

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.

josephlx commented 1 week ago

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.

Maaarkie commented 1 week ago

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