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
12 answers
Sort by: Most helpful
-
Pantsleftinwash 5 Reputation points
2024-10-17T14:06:03.73+00:00 -
Limitless Technology 44,526 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.
-
TravisR 0 Reputation points
2023-11-27T05:02:53.7266667+00:00 Apologies for commenting on an old post. I've been having this issue for years, but it's been significantly more frequent throughout 2023.
For me the issue was related to my screenshot tool. It automatically copies the captured area as a PNG image to my clipboard, which appears to make WSL very unhappy with me. Clearing the clipboard by copying some other random bit of text helps calm it down after several seconds.
It appears to be the most impactful after I've used WSL in some way, but can happen with or without Docker running as well (no idea why). Clearing the clipboard in these cases also helps.