I get this on win10 + WSL2 - When wsl --shutdown
fails, from an admin powershell you can beat wsl to death with Get-Process | Where-Object { $_.Name -like "wsl*" } | Stop-Process
High CPU usage for vmmem
Hi,
I have experienced high CPU usage for Vmmem frequently (~every 2days) and the only solution at the moment is simply restart my machine.
It is understood that is related to WSL and I do have a Docker image running on Ubuntu on Windows. However it is not really responding for Ubuntu and Docker (see below) and CPU usage is still that high even I manually close Docker Desktop and run cmd wsl --shutdown.
It's really disruptive for me and any opinion would be appreciated.
Cheers
Steve
17 answers
Sort by: Most helpful
-
Pantsleftinwash 5 Reputation points
2024-10-17T14:06:03.73+00:00 -
Limitless Technology 44,371 Reputation points
2023-03-22T14:19:50.54+00:00 Hello
Thank you for your question and reaching out. I can understand you are having query\issues related to vmmem high CPU usage.
When Docker is running, it uses memory just like any other virtual machine in any virtualizer. Docker is a sort of virtual machine.
It suggests that you create the following text file at:
C:\Users<your-username>.wslconfig
[wsl2]
memory=2GB # Limits VM memory in WSL 2
processors=1 # Makes the WSL 1 VM use two virtual processors
Reference :
https://devblogs.microsoft.com/oldnewthing/20180717-00/?p=99265
--If the reply is helpful, please Upvote and Accept as answer--
-
Antonio Torres Vargas 0 Reputation points
2023-09-13T14:57:56.0433333+00:00 This worked for me.
Create the following text file at:
C:\Users<your-username>.wslconfig
[wsl2] guiApplications=false
then restart the PC
-
Qwerty Vítězslav Ackermann Ferko 0 Reputation points
2023-09-13T15:06:04.68+00:00 It is not possible to kill the process, but you can change it's affinity.
Running
wsl --shutdown
in administrator cmd seems to have worked for me in the end as well.Anyway, I want to point out that in my case, the issue was caused after I stopped Docker. After that I could not even restart it as it got stuck on the launch screen.
-
Jiri Hajek 20 Reputation points
2023-09-21T06:59:58.25+00:00 Just fyi, while I had several instances of this issue in the past, it doesn't happen anymore, haven't had it in the past months. Not sure what changed, my PC usage seems to be pretty much the same, so possibly some of the updates.