-
Notifications
You must be signed in to change notification settings - Fork 821
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 high CPU usage #6982
Comments
Today, after wake up from sleep I managed to repro. |
The day after, also waking up from night sleep. Like @Matsemann |
The high CPU usage can be seen from Task Manager |
Yes, and from the htop screenshot. But you cannot see what is using the CPU (other than the generic |
This comment was marked as outdated.
This comment was marked as outdated.
Update, I can reproduce this 100% of the time by turning off my 2nd monitor (one core in Linux gets pegged to 100%, but htop doesn't show any processes using CPU power). If I run 'xeyes', as soon as xeyes open the mystery CPU usage disappears, so I assume it's something to do with the new graphics integration, and actually running a program gives it a kick? |
Great find! I've always experienced it after computer has been sleeping (like when coming back after lunch), but I also can reproduce it by reconnecting a monitor. Which I guess is what happens when the computer starts after sleep. Running xeyes or any wslg app doesn't seem to stop it here, though. |
Yes, if someone from wsl team could tell us how to give them better diagnostics that would be nice. As we've said, nothing shows up as using resources in the wsl images themselves. But we can see a high cpu core usage in htop, or vmmem cpu usage in task manager. But don't know how to see what is causing it. |
Can confirm,
I tried messing with refresh rate (my first monitor has 144, my second 60), but no luck. In the process, I found that when I tried to change the refresh rate, the screen "refresh", then the 100% core in htop gone. Although, currently its fresh restart and reproduced reliably, but only 1 core spinning up. In the past I had like 3 core spinning up out of nowhere. I also use Docker for Windows, which for this purpose I turn off first, because I also had bad experience on that docker hogging CPU while no container running Update Windows 10, build 21390.2025 |
I think this is indeed related to WSLg, which creates a hidden "system distro" instance for each running user distro. That's why you can't see anything in htop. When the 100% core usage happens you can run this from the terminal: I bet the culprit is the |
As a possible confirmation of this, I had this issue continuously (with vmmem using 50% of CPU without anything running on WSL2). I disabled WSLg in wslconfig and restarted the distributions. The issue (so far) seems to be fixed. |
With |
If it helps, I was already running 1.0.24 (updated yesterday) and still seeing the issue. Disabling WSLg seems to have fixed it. I'll keep testing. |
I too can reproduce this 100% by turn on/off my second monitor. Is this issue user "workaround-able" or do we have to wait for Microsoft. If so is there a way to expedite such a serious issue? Side note: opening xeyes only drop the CPU usage from 25% to 17%. and after I closed xeyes the cpu went back up to 25%. So far I have not found a reliable way to make it run normally again other than to disable wslg with |
@lishan89uc have you tried |
I occasionally get this issue as well and it usually gets fixed when I shut down the WSL completely. This time I tried pressing the Win+Ctrl+Shift+B combo and that seems to have fixed the CPU usage in this instance. |
I also experienced this today and the Worth mentioning that this is now happening on Windows 11:
|
Also happened on mine. Consistently happens after locking the screen. My system is a laptop with internal 4K display (switched off) and external 5K display via Thunderbolt (set to second screen only). |
When vmmem's CPU usage is very high, in my case, stopping Docker desktop solved the problem.
|
This seems to work for me as a temporary fix. I'v see this in a few different states, either 1 CPU core or 3 CPU cores all at 100% and nothing showing up in top etc as actually using CPU.
|
If you don't need gui apps then you can disable wslg while waiting for a fix. I did it a couple days ago and it seems to have stopped the high-cpu-after-sleep issue. Add the following to
See https://github.com/microsoft/wslg#wslg-system-distro |
I do not use sleep mode on my office PC, it is always on. And I have the same problem. Perhaps it appears after connecting via RDP, but I cannot confirm this yet. |
Could somebody who is hitting this provide the output of dmesg? I suspect this is WSLg-related. |
Hi folks, I was having issues with I hope this is relevant and helps someone else in a similar predicament. |
I also use power toys, but at the moment the cpu load is normal and cannot confirm. Interesting) |
Another thing I notice is that Steps:
|
@ctataryn sorry, can't confirm. As soon as I shutdown the wsl, vmmem is gone |
worked for me |
I'll have also two devices suffering from this. One using debian, one using ubuntu. Sometimes working with the basesystem becomes realy nerf-racking because the whole system becomes unresponsiv. |
Still an issue with the latest WSL, is anyone working on a fix for this one? |
@AtleWebstep There is a community effort on trying to find the kernel commit which introduces this issue. You can follow or help here: carlfriedrich/wsl-kernel-build#1 |
This comment is pure gold, thank you. |
Docker even if the desktop version is off in Windows, seems to be running in WSL and resulting in high CPU usage (Vmmem process) in Windows (while not reflected in Ubuntu). Ex: I've run: After: The Vmmem process on my Windows machine dropped to 0 - 3% CPU usage. I know this is not a fix and just a workaround, I just thought to share it. |
Thanks for the instructions. When I try to run
@OneBlue I noticed today that the |
If you try to run |
Installing anything in cbl mariner was incredible pain to me. DNS resolving didn't work for me neither in ubuntu nor in CMB Mariner, so first I needed to fix DNS by putting 8.8.8.8 into /etc/resolv.conf just by using:
Then I got SSL errors, so I had to disable the SSL checking just by using sed (no better editor available!)
Finally installed at least vim :) |
I see 100% at /sbin/init, but only in ubuntu, not in cbl-mariner. strace -p 1 rolls fast in ubuntu, but has only two lines in cbl-mariner. |
Changing wsl --version |
Worth mentioning, that this issue is highly related to #8696 WSL is non-responsive after waking from hibernate & also the community is Trying to find the kernel commit which makes WSL non-responsive |
@anodynos thanks for linking the related issues. I just noticed that I had a high CPU usage coming from VmmemWSL without having my PC set to hibernate before. Unfortunately, I still cannot run
When my
Restarting my graphics driver with My WSL version is:
I cannot run
Any idea how I can support debugging the issue? I would love to provide more useful logs if possible. In the "Reliability Monitor" from Windows I can see the following events if WSL stops working: EDIT: I can now reproduce this high CPU usage everytime I am starting VS Code and opening up a |
I also added this exclude pattern but my @glazzari, do you maybe know how I can get VS Code debugging logs? |
Same here. I think you can use |
I can not run this command. It results in an error. Details:
I did try to enable dbug shell as describe here: #7930
|
@matra774 I just noticed the same issue... When running Screenshot: |
Same issue here |
I have same problem. vmmem process is going to high in intervals. My notebook's fans go to max rotations and it is very annoying. Some cores go to 100C I have windows 11, CPU 13th Gen Intel(R) Core(TM) i7-13700H |
My computer has been freezing, with VMmem always using a lot of memory and the fan going to max rotation. I decided to uninstall WSL, and now everything is going well. |
This is not a MeToo thread. Read the messages above on how to provide meaningful diagnostic data. |
Let me provide a high-level recap on this long thread. :-) It has many reports of high CPU usage on the Windows/Hyper-V host, and hangs in the WSL Linux VM. For the most part, the reported symptoms are somewhat generic, which is a starting point, but usually doesn't help get to the root cause. That said, we have gotten enough diagnostic details to identify one root cause, but there may be other root causes that produce the same generic symptoms. Here are the details of the known root cause:
I worked on this problem a year ago as a Microsoft employee doing Linux kernel work. I've since retired from Microsoft, but have kept an interest in this problem, and have been in contact with my former colleagues on the Hyper-V and WSL teams at Microsoft. They are still working out how they want to move forward with a resolution. In the meantime, the WSL user community has built and tested custom WSL Linux kernels that don't enable the problematic feature described in (3) above. The reports from the WSL community are that these custom kernels solve this specific root cause. Again, see carlfriedrich/wsl-kernel-build#1 for information about getting one of these custom kernels. If someone is seeing WSL hangs, and high CPU usage on the Windows Hyper-V host, and your environment meets the pre-requisites for this known root cause, you might try one of the custom kernels to see if it fixes your symptoms. If your environment doesn't meet the pre-requisites, then your problem is likely a different root cause. For example, there's been some recent discussion on this thread of issues related to VS Code, and that's almost certainly a different root cause. Unfortunately, I don't have any expertise to offer on these other potential root causes. |
|
Thanks, finally a solution that doesn't require local admin or rebooting. |
I noticed this in my PC. Everytime i notice high CPU usage, I have noticed this. Just too many wsl processes. On top of that, disk usage sky rockets to 100MB/s This generally happens when WSL (Ubuntu22.04)+VSCode+Docker is used together. My guess is the way VS Code connects with WSL images is the key problem here. Because after some time of idle system (8+hours) VSCode attempts to connect with WSL and upon failing it opens a new socket/connection with WSL and forgets to remove previous connection. Due to this a number of WSL connections are opened. When VScode updates itself with new connection, it queries all the connections there are resulting in increased CPU usage, Disk usage. Of course I can be wrong here as this is just based on observation of user experience and is personal experience. But this is my understanding of this observation. As people have suggested to kill the WSL and it generally solves the problem, I believe all connections to VScode are killed and a new one is opened that results in smoother output. Same thing (my guess, not observed or tested in any way) happens when system restarts. Connection Pool Resets and things start working smoother. On unrelated note: Combine this with Google Chrome and an adblocker, you get even higher usage of processor/cores resulting in complete halt of system. This is my theory. While writing above, I reloaded VSCode and it spewed this out. I do not know what it means. My System has13thGen i7, 64GB Ram, 3080Ti Card. So system specs are more than optimal for WSL to run but I am unable to figure it out further. |
Windows Build Number
Microsoft Windows [Version 10.0.21387.1]
WSL Version
Kernel Version
5.10.16
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
I'm struggling to actually repro this issue deterministically. But looks like more prominent when waking up from sleep.
Whit this issue I'd like to gather feedback on how to collect the most useful information to debug this behavior.
I tried to isolate the failing component (ex. not running Docker Desktop and WSL2 "only"), but I failed miserably.
Usually my workflow:
In the past I tried to alleviate the issue with a
.wslconfig
but didn't worked.My machine (Lenovo X1 Carbon) has 16GB of RAM and usually Vmmem RAM consumption float around ~4GB.
Excluded those hiccups WSL2 experience is pretty neat and flowlessy.
Expected Behavior
WSL2 stay idle when no user workload are launched.
Actual Behavior
Vmmem "randomly" uses high cpu/power amount (60%-70%) for couple of minutes (2 to 5 min) before settling down. This also happen when on battery without doing anything WSL2 releated (but with Docker Desktop running), killing autonomy.
Diagnostic Logs
I'll provide an .etl dump as the next hiccup occurs.
The text was updated successfully, but these errors were encountered: