WSL: WSL high CPU usage and hangs all requests after some sleep-resume or hibernate-resume cycles
Windows Version
Microsoft Windows [Version 10.0.22000.1696]
WSL Version
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.22000.1696
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
Default Distribution: Ubuntu-22.04 Default Version: 2 WSL1 is not supported with your current machine configuration. Please enable the “Windows Subsystem for Linux” optional component to use WSL1.
Distro Version
Ubuntu 22.04
Other Software
During the sleep-resume or hibernate-resume cycles following software is running: vscode: 1.76.2, WSL extension: v0.76.1 explorer with wsl drive open
Repro Steps
Use wsl with vscode, open drives in windows explorer, use other apps which use the filesystem from the WSL.
Do a lot of sleep-resume cycles, while other software accessing the WSL works.
Once in a while after sleep-resume notice that the VmmemWSL process CPU usage is high. Attempt to access the WSL FS via explorer - it hangs opening it, use vscode - it says WSL is not responsive.
Try to shutdown the wsl to restart it using wsl --shutdown - the operation hangs, never completes.
Expected Behavior
The WSL always works normally after sleep-resume / hibernate-resume cycle.
Actual Behavior
After some sleep-resume / hibernate-resume cycles the WSL hangs, CPU usage spikes, and WSL doesn’t respond to any commands. wsl --shutdown doesn’t stops the wsl, and just hangs.
Diagnostic Logs
No response
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 13
- Comments: 20
Have you tried this workaround:
taskkill /IM wslservice.exe /Fin a console running as administrator to restart the VM.
I keep using that command regularly to restart WSL.
There is no proper solution, Microsoft ignores the problem.
@thfrei
I’m sorry to report, I had that line in .wslconfig, and I’m on Windows 11 (Dell XPS 17 purchased January 2022) and still had the vmmem 100% CPU problem.
Another workaround (requires PSTools):
pskill wslservice.exe & pskill wslhost.exeThis seems like a power management issue as I regularly hibernate my system and this issue only makes itself evident coming out of hibernation (others have said sleep mode).
+1 Have the same issue with vmmem spking cpu usage. However,
wsl --shutdownwill eventually close vmmem process and system returns to normal. Shutdown takes approx 1-2 minutes.One trial to fix it was: I adapted the
$USER/.wslconfigfile according to: https://tkacz.pro/wsl-fix-vmmem-high-cpu-usage/ - However this solution does not really seem to fix the issue. Maybe it helps with shutdown working.I read somewhere, that apparently it should not occur in Windows 11 anymore. Windows 11 also has some more wsl2 features like usb pass-through or mounting which is missing in Windows 10 😦