Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vmmem eating up CPU after last update even without running any docker image #8742

Closed
2 tasks done
Bleki opened this issue Oct 1, 2020 · 50 comments
Closed
2 tasks done

Comments

@Bleki
Copy link

Bleki commented Oct 1, 2020

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: E550E750-34CD-4202-8F8A-A1A0D5C97B9C/20201001091450

Expected behavior

No Vmmem high CPU usage

Actual behavior

High CPU usage for Vmmem

Information

  • Windows Version: Windows 10 Enterprise
  • Docker Desktop Version: 2.4.0.0 (48506)
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No, it's a desktop Windows.

Steps to reproduce the behavior

  1. Start Docker Desktop
  2. Watch CPU usage in Task Manager for Vmmem
@johanseland
Copy link

I can confirm that I am also experiencing this problem. I am running Windows 10 Pro and using Docker Desktop 2.4.0.0 (48506)

For me, the high Vmmem CPU usage seems to be tied to running compilation of a large C++ code base using parallel make/ninja.

@johanseland
Copy link

I did some more digging into this and I have come up with an acceptable workaround. I wonder if the root causes it that Docker Desktop 2.4.0 uses slightly more memory than before, causing the system to start paging to this earlier than it did for 2.3.

These are my observations:

  • The problem goes away for some time if I drop the Linux caches (e.g. echo 1 > /proc/sys/vm/drop_cache inside a wsl2 session)
  • The vmmem process seems to be hogging all CPU, I suspect it is busy waiting when waiting for memory that has been swapped to disk.
  • If I reduce the amount of memory available to wsl2 by editing .wslconfig I am not running into this problem.

According to https://docs.microsoft.com/en-us/windows/wsl/wsl-config the default available memory to wsl2 is 80% of physical RAM. On my 16 GB machine this amounts to 12GB, which was enough for the system to start swapping with quite light usage of application on the host system (e.g. Visual Studio Code, Edge, some terminal windows). Limiting the amount to 10GB removed the problem for me altogether yesterday. I could successfully run the large compilation mentioned above without vmmem using all CPU.

@inhumantsar
Copy link

Can confirm that editing wsl-config to enforce global resource limits helped stabilise memory and CPU usage.

Worth keeping in mind just how much memory all this stuff takes up though. On my system, after a fresh reboot and starting up Docker Desktop, vmmem usage sits around 1.5GB. +1GB for K8S. +1GB if I open up a new distro (Ubuntu 20.04). If the limits are set too low, the VM will start swapping again.

@ERGeorgiev
Copy link

Some CPU and all of my ram, nothing running. Happened after a build, it's been 30 minutes and its still sitting there. Shutting down docker does not help.
Docker_Desktop_B47KC5fcCL

@cactysman
Copy link

cactysman commented Jan 7, 2021

This started happening to me too over the past few days.
Took a while to identify Docker Desktop as the cause.

Taskmgr_2021-01-06_16-43-12

@cactysman
Copy link

Disabling the Kubernetes cluster fixed this for me btw, so there gotta be an issue with that part(?).

@mediplex
Copy link

Same issue here.
vmmem takes 2gb+ after a reboot and no container running yet!
Once I run my dev container it eats up all the remaining memory.

Config: windows 10 20H2 (latest) and docker 3.1 (latest)

@sergey-derugo
Copy link

Same issue here.
vmmem takes 2gb+ after a reboot and no container running yet!
Once I run my dev container it eats up all the remaining memory.

Config: windows 10 20H2 (latest) and docker 3.1 (latest)

https://medium.com/@lewwybogus/how-to-stop-wsl2-from-hogging-all-your-ram-with-docker-d7846b9c5b37 helped me

@ivanrodriguezfernandez
Copy link

ivanrodriguezfernandez commented Mar 12, 2021

In the past we could configure limits with .wslconfig but now my computer ignore this seetings.

Microsoft Windows 10 Enterprise (10.0.19041 N/A Build 19041)
Docker for Desktop: 3.2.2 (61853)

@liny01-nbsa
Copy link

Same issue.

Windows Version: 20H2 (OS Build 19042.804)
Docker for Desktop: 3.2.1

@Dherlou
Copy link

Dherlou commented Apr 17, 2021

Same issue here. WSL already consumes like 12 out of my 16 GB RAM after startup, although not a single container is running.
Currently mitigated by above workaround with limiting the memory, but this is surely not a suitable fix.

Windows Version: 20H2 (OS Build 19042.928)
Docker for Desktop: 3.3.1

@Marcin-TA
Copy link

I have the same issue. 100% CPUT and 80% RAM is used by Vmmem.

@acurvers
Copy link

acurvers commented Apr 22, 2021 via email

@Gabriellavoura
Copy link

Gabriellavoura commented Apr 25, 2021

Same here, 98% RAM (15.4GB) and 100%CPU used by Vmmem, with no containers running.
Win pro build 19042
WSL2
Docker Desktop version 3.3.1 (63152)

@onomatopellan
Copy link

onomatopellan commented Apr 25, 2021

@Gabriellavoura You can specify the max RAM Docker WSL2 can use thanks to the .wslconfig file.

[wsl2]
memory=8Gb

@Gabriellavoura
Copy link

Gabriellavoura commented Apr 25, 2021

@Gabriellavoura You can specify the max RAM Docker WSL2 can use thanks to the .wslconfig file.

[wsl2]
memory=8Gb

Thanks @onomatopellan, I have already done that, just posted here to say that this problem wasn't fixed yet.

@rnemeth90
Copy link

rnemeth90 commented May 13, 2021

Same issue here. VMMem process is using 2-3 GB of RAM, despite no running containers. Kubernetes is not enabled.

Docker Desktop: 3.3.3 (64133)
Windows 10 Enterprise 21H1 (19043.964)

Setting memory limits for WSL is not a solution in my opinion, as it will limit the number of containers I'm able to run concurrently.

@kamerat
Copy link

kamerat commented Jun 3, 2021

Same for me. Even after quitting docker-desktop (Right click - quit docker desktop) vmmem does not exit.

Also, even tho Docker is not in boot, vmmem still spins up.

Manually doing wsl --shutdown in a terminal makes it stop though.

@vanquang9387
Copy link

Same for me.
vmmem takes ~ 2GB memory without running any images.

Edition Windows 10 Pro
Version 21H1
OS build 19043.985
WSL2
Docker Desktop verion 3.3.3

@Matsemann
Copy link

Matsemann commented Jun 4, 2021

$ wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-20.04           Stopped         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2

$ docker ps
<nothing>

even with this, vmmem sometimes uses ~50%+ cpu and a couple of gigs of ram. wsl --shutdown and restarting docker engine works, but only temporarily. If I run my Ubuntu image and run htop, I can see lots of memory and cpu being used, but not any processes using that cpu/ram.

@konradgadecki
Copy link

C:\ > wsl --list --verbose
  NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2
C:\ > docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
<nothing>

I noticed this issue happens right after I create a docker image with docker build command locally on my pc. Memory utilization by vmmem process grows rapidly and never goes down, even if Docker Desktop (the latest version) is restarted. Only pc restart helps in this case for me so it all of this makes a local development difficult. Is there any solution?

image

@duemti
Copy link

duemti commented Jul 5, 2021

"docker will simplify the development" ... they said. Now my pc sounds like a jet engine. Also, spent ton of time figuring why that happens, to also find that i can't stop it (not at least without much overhead).

@paulmiller3000
Copy link

Same issue here.
vmmem takes 2gb+ after a reboot and no container running yet!
Once I run my dev container it eats up all the remaining memory.
Config: windows 10 20H2 (latest) and docker 3.1 (latest)

https://medium.com/@lewwybogus/how-to-stop-wsl2-from-hogging-all-your-ram-with-docker-d7846b9c5b37 helped me

This work-around fixed it for me as well. Would be nice if we could get a fix for this.

@danmaina
Copy link

danmaina commented Jul 19, 2021

An alternative workaround that worked for me was to disable WSL 2 and use Hyper V. Docker may not be as fast but at least resources are much more reasonable.

Disable WSL 2 use in docker under settings

image

Disable WSL in windows features

image

image

If you are using WSL for other tasks or want the extra docker perfomance, this may not be the solution you are looking for. It works only as a workaround.

@canardaaydin
Copy link

Same issue, even though non of the containers are working, vmmem eats 16.5gb of ram.

@UltraWelfare
Copy link

UltraWelfare commented Aug 20, 2021

Same issue here. Not a single container ever created, it will still eat all of the RAM.
The .wslconfig isn't a fix as VMmem will still eat up to the limited amount specified on the file...

@kamerat

This comment has been minimized.

@UltraWelfare
Copy link

An alternative workaround that worked for me was to disable WSL 2 and use Hyper V. Docker may not be as fast but at least resources are much more reasonable.

This is a good solution but unfortunately not available to users with Windows 10 Home.
Hyper-V is only available for "Windows 10 Enterprise, Pro, or Education" (source)

@therealdandecker
Copy link

@danmaina the Hyper-V solution is the only one that worked for me as well (tried wslconfig and all that.) It is really maddening that this issue seems to get largely ignored.

@Matsemann
Copy link

Relevant (but maybe not exactly the same) issue over at wsl microsoft/WSL#6982 (comment)

@philippeantonietti
Copy link

same problem, docker is consuming a tremendous amount of CPU =(

@rcyost
Copy link

rcyost commented Sep 27, 2021

same :(

@Marcin-TA
Copy link

I noticed that version 4 of docker is super slower on win10 :(

@Dolaned
Copy link

Dolaned commented Oct 12, 2021

This is happening to me running docker in a nested vm on a 5950x on windows 11, the VM is windows 10

@DarioLopes
Copy link

DarioLopes commented Nov 16, 2021

Hi same here, Docker is pretty useless on Windows (run fine on Ubuntu though)

@kasvith
Copy link

kasvith commented Dec 28, 2021

Hi Im having the same high CPU usage problem.

@LaBlazer
Copy link

Any update on this? I'm experiencing the same issue...

@brunosalvino
Copy link

Same here: after Windows startup, I start Docker Desktop, "Vmmem" memory usage goes to 2GB without any container running. I'm sitting here looking at Task Manager and "Vmmem" memory usage keeps going up all by itself. It has to be a memory leak.

Windows 10 Pro 21H2 build 19044.1466
Docker Desktop 4.4.4 (73704), Docker Engine v20.10.12

.wslconfig
[wsl2]
memory=4000MB
processors=4

@lojell
Copy link

lojell commented Feb 9, 2022

Same issue for me, high memory consumptions even when no containers are running

@Steven73041
Copy link

Same here in windows 11. Docker not running at all but CPU 100% + RAM consuming. I opened docker and closed it and fixed.

@luxalpa
Copy link

luxalpa commented Mar 6, 2022

I have the same problem. I don't have WSL set up but instead use the Hyper-V version. Docker Desktop is not running. Launching it shuts down the Hyper-V machine and then starts it again, resolving the issue. There's also tons of error messages in the console but I wasn't able to capture those yet. I only remember that it was something about vpnkit (I don't use a VPN).

@jimmycd
Copy link

jimmycd commented Mar 11, 2022

+1
Win 11
image
.wslconfig is

[automount]
root = /

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

[user]
default = root

image

after fresh reboot (docker desktop autostarting, kubernetes active, nothing else active on the machine) -> CPU Fan goes wild
image

try #1: stopping Kuberntes, docker desktop still active -> no change
try #2: disabling wsl distro integration -> no change
try #3: stop wsl: wsl -- shutdown --> vmmem dispappears (no wonder)
try #4: bash (starts wsl default distri) -> normal behaviour (only default distri is up)
try #5: restart docker desktop: now all 3 distris are up and NORMAL BEHAVIOUR!

--> wsl -- shutdown and restarting docker-desktop is a workaround (and only this).

@paddelboot
Copy link

Similar issue here. Docker Desktop is consuming ~20% of CPU without any containers running.

Vmmem is consuming ~2GB in idle.

image

image

image

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@NebraskaCoder
Copy link

Sad to see this issue go 'stale' with no resolution.

@Dherlou
Copy link

Dherlou commented Aug 8, 2022

/remove-lifecycle stale
Far from stale, unfortunately...

@BarMol3
Copy link

BarMol3 commented Aug 19, 2022

Still very much an issue!

@Steven73041
Copy link

For me, after updates it is ok.

@nicks
Copy link

nicks commented Aug 22, 2022

Hi all! sorry to hear you're having problems.

From the history of this thread, it sounds like there are several different issues related to CPU/RAM usage being reported here -- some are fixed and some might not be. The original issue has a workaround that is described further up-thread (editing the wsl-config - #8742 (comment)). Some of the issues are tracked elsewhere in this issue tracker.

Because the original issue has a workaround, I'm going to close this. It's hard for us to inform people when your individual issue is fixed if we're lumping all resource utilization problems into a single issue.

If you believe your problem is still there, please file a new issue with specific repro steps and a diagnostic ID.

@nicks nicks closed this as completed Aug 22, 2022
@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests