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

WSL2-Vmmem with Docker desktop will use 100% CPU for no reason after PC wakes up from sleep

Open hrsto opened this issue 3 years ago • 70 comments

  • [x] I have tried with the latest version of Docker Desktop
  • [x] I have tried disabling enabled experimental features
  • [ ] I have uploaded Diagnostics
  • Diagnostics ID:

Actual behavior

In some cases after PC wakes up from sleep, Vmmem will be using 100% CPU and the only to way to stop is to shut it down completely. Docker desktop doesn't have any active containers. No issues observed prior to installing docker. Subsequently, If docker has been disabled, this behavior is not observed. There is also a notification saying that docker backup has failed.

Expected behavior

Information

Up to date everything on a windows 11 pro with WSL2 and docker desktop with just WSL2 backend.

hrsto avatar Sep 17 '22 23:09 hrsto

Hi, I have the same issue even after a full restart / reboot. Since 4.12, docker appears to be broken and WSL is unusable since the CPU & Memory usage from Vmmem is too high and no terminal can be opened.

peterjuras avatar Sep 18 '22 04:09 peterjuras

Same, I was just about to report this as well. Windows 10, WSL 2. It's a memory leak. I purged ALL data. This brought it down to around 2gb of RAM usage...still pretty high for no running container.

c0dezer019 avatar Sep 19 '22 04:09 c0dezer019

So, after purging data, Docker runs at a subpar reasonable level with no container or any images. around 2gb of RAM give or take. Then rebuilding Docker image, this jumps up to around 3gb. After image is built, my image performs a butt load of database migrations. This brings it up to 3.6gb of RAM usage. With that complete, and container running and in the shell of container, usage is now at 4.6gb. Even shutting container down, usage remains as is until I shut Docker down.

c0dezer019 avatar Sep 19 '22 04:09 c0dezer019

Running wsl --shutdown to kill the VMs works but takes a few minutes. Docker Desktop or Jetbrains IDEs using WSL are basically hung and won't quit until the VMs are killed

I tried manually quitting DD before putting my computer to sleep yester and had no problems when it woke up today.

dan-didjatv avatar Sep 22 '22 16:09 dan-didjatv

Not entirely sure if this a docker issue - without running Docker desktop I have the same issues in Windows 11.

imdavidmin avatar Sep 22 '22 18:09 imdavidmin

Not entirely sure if this a docker issue

I don't know about others, but I only started having this issue after the most recent Docker Desktop update

dan-didjatv avatar Sep 22 '22 20:09 dan-didjatv

Same, Docker Desktop is the cause. Now i know it to be slightly different on Windows but on Linux, Docker Desktop requires Docker Engine, which is a separate install. I cant imagine it being any different on Windows, except that Desktop and the Engine are bundled together and is only started when DD is running. That being said, I think the issue COULD be engine related, and not necessarily the Desktop part.

c0dezer019 avatar Sep 22 '22 21:09 c0dezer019

I'm having similar issues. I find that it often happens when my laptop goes to sleep when its plugged in, but I wake it up after I've removed the power chord. Then wsl and docker engine both hang using 100% until I restart the computer. Docker is unresponsive to commands like docker stats or otherwise in the meantime

jacobEAdamson avatar Sep 23 '22 02:09 jacobEAdamson

I have the same issue since yesterday (2022-09-24) probably following updates, 100% CPU of vmwp.exe following wakeup from sleep/hibernate wsl true is not responding all WSL UI applications are not responding, wsl --shutdown is not responding.

This is not related to docker, please modify the title and remove the docker keyword.

Recent updates:

  • KB5017328
  • KB5017497 Relatively recent updates:
  • KB5016629
  • KB5012170

This is a CRITICAL issue.

>wsl --status
Default Distribution: Ubuntu-22.04
Default Version: 2
WSL version: 0.66.2.0
Kernel version: 5.15.57.1
WSLg version: 1.0.42
MSRDC version: 1.2.3401
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.978

alonbl avatar Sep 24 '22 18:09 alonbl

Also just had this happen even after shutting down DD before sleeping. docker-desktop wsl is still running though, all wsl apps and terminals frozen

PS C:\Users\xyz> wsl -l --running
Windows Subsystem for Linux Distributions:
Ubuntu-22.04 (Default)
docker-desktop

Was able to run wsl --shutdown which took a couple minutes but succeeded. Wsl is working again.

dan-didjatv avatar Sep 25 '22 00:09 dan-didjatv

Thanks for the reports, all. We found the upstream discussion that @alonbl pointed to helpful, in particular this one: https://github.com/microsoft/WSL/issues/6982

Our current hypothesis is that this is a WSL2 bug. But we're not sure yet what the necessary conditions are to reproduce it, or if there's something DD should be doing differently to prevent it.

nicks avatar Sep 26 '22 19:09 nicks

For me, after update "KB5017383" seems to solve the situation..

civanescu avatar Sep 27 '22 15:09 civanescu

For me, after update "KB5017383" seems to solve the situation..

How long have you been running docker and just doing your normal routine after installation of update?

hrsto avatar Sep 27 '22 17:09 hrsto

Today, 2022/10/08, it happened again. With CPU 100% used. I checked I have KB5017383 installed. So KB5017383 does not solve the problem.

shipingli avatar Oct 07 '22 23:10 shipingli

It seems that after the 22H2 windows 11 update, this problem has disappeared. For a while i've been running docker normally and not a single time the issue has occurred. For that reason, i will close this. Please open again if this problem haunts you.

hrsto avatar Oct 17 '22 20:10 hrsto

Hi @hrsto I have just experienced this on a fully updated Windows 10 installation, so I think it is still an issue

JonasJes avatar Oct 19 '22 12:10 JonasJes

I have the same issue on Windows 11 22H2, still. It happens after awaking from sleep (not always, but pretty regularly). But as some have pointed out, even if I am disabling (= not starting after boot) Docker Desktop, the issue still persists.

So my suspicion would also be that WSL itstelf might be the issue. Although ofc I have not uninstalled Docker just not running it.

Edit: Also, just to clarify, the 100 % CPU usage of vmmem is permanent until system restart and does not dissapear after stopping any workloads (like descirbed in the linked issue https://github.com/microsoft/WSL/issues/6982)

codekoenig avatar Oct 21 '22 09:10 codekoenig

It seems this https://github.com/microsoft/WSL/issues/8824 is the correct related WSL issue (complete freeze after standby, shutdown does not work) and they already fixed it by a workaround, so hopefully, this will be solved by an update soon.

codekoenig avatar Oct 21 '22 09:10 codekoenig

Latest WSL2 is now stable and can be started with systemd support. In /etc/wsl.conf write the following and restart WSL2:

[boot]
systemd=true

I installed docker 'natively' within WSL2 itself using the official guide and so far it runs great.

While i still need more time to fully assess its viability, if someone is still experiencing issues with Docker Desktop, this might be a viable option worth exploring.

PS ... > wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819

hrsto avatar Nov 19 '22 08:11 hrsto

WSL2 still has a problem with the Docker desktop. This happens without any reasons or actions and docker stops working correctly! You can run wsl --shutdown as administrator in PS to stop consuming 90-100% of your CPU, then restart docker. Another solution noted by @fmiqbal is pressing Win+Ctrl +Shift+B, which restarts your graphics driver! The config file is available in \\wsl$\ (to try possible configurations), but I haven't found a solution regarding the configuration change. Needless to say, it's a high-priority bug affecting hardware, especially when your CPU fan is silent!

Docker Desktop: 4.15.0 Windows 11: 21H2, Build: 22000.1335, and updated WSL: 2

Mazoy avatar Jan 06 '23 09:01 Mazoy

Same issue here, Docker desktop on Windows 11 machine with Core i9 and 128 GB Ram vmmem consuming 100% CPU and 45 GB RAM makes my dev machine completely hung and I need to reboot. Issue is sporadic, I haven't found a way to manually trigger/reproduce it.

dm-pr avatar Jan 13 '23 08:01 dm-pr

Same issue here also. Annoying as hell as all my cpu is used by vmmem

omasseau avatar Jan 18 '23 12:01 omasseau

Similar issue, have Docker running (with no running containers!) and vmmem will end up eating all of my RAM (32gb). Doesn't seem to use the CPU though. In some cases wsl --shutdown will work, in others it will hang and I'm forced to reboot. Real bummer because WSL2 + Docker works great otherwise, but I don't see how this is going to be practical like this.

Edit: Just installed 22H2 for Windows 10, started up Docker and vmmem was using over 15gb of RAM within 5 minutes. Again, no running containers, no activity in WSL other than starting Docker and opening a WSL shell.

atzemis13 avatar Jan 20 '23 05:01 atzemis13

I have exactly the same issue. Completely freeze. Happens randomly but at least once a day. wsl --shufown doesn't work WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19044.2486

dragon0087 avatar Jan 25 '23 03:01 dragon0087

I had the same problem and it somehow got worse with time. Then I ran wsl --update to update the Windows Subsystem for Linux. Since then, everything works fine.

It's kinda odd that Docker for Desktop Windows doesn't suggest updating this, or maybe there should be a clearer dependency on it in the first place?

Narretz avatar Feb 07 '23 10:02 Narretz

I have exactly the same problem and WSL would spin out of control 100% with over 6GB RAM used.

I have since uninstalled Docker for Desktop and installed Rancher instead to try to work out if that's the culprit.

Today I had the same 100% CPU usage, however vmmem was only at 26MB.

Using a wsl --shutdown eventually worked but took a very long while to do so.

I hibernate my PC FWIW.

ElvenSpellmaker avatar Feb 14 '23 19:02 ElvenSpellmaker

Same issue persists. I even avoided Docker Desktop bloat, went directly for Docker CLI, but yet my ram usage rockets to 11 GB, CPU usage rockets to %100 when I want to build a Dockerfile.

AAAAAAAAAAAAAAH.

caner-cetin avatar Feb 16 '23 15:02 caner-cetin

Fresh uninstall/install of latest docker desktop on Win 10, and my CPU spikes > 50% usage with no containers running :( How is this not a higher priority for the developers? I've seen about 20+ github issues for this exact issue.

captainfalcon23 avatar Feb 16 '23 22:02 captainfalcon23

Same problem (100% cpu usage). Problems start after waking up from hibernation. Shutdown doesn't work in most cases. WSL version: 1.1.3.0 Kernel version: 5.15.90.1 WSLg version: 1.0.49 MSRDC version: 1.2.3770 Direct3D version: 1.608.2-61064218 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19043.236

echeg avatar Feb 17 '23 07:02 echeg

The same here. I can not stop Docker Desktop, can not start Docker desktop. wsl -- update shows I have the latest version. wsl --shutdown hangs.

My workaround:

  1. Open console in administrator mode
  2. Call: TASKKILL /IM "wslservice.exe" /F
  3. Quit Docker desktop
  4. Open Docker desktop

tomaszs avatar Feb 27 '23 11:02 tomaszs