High CPU usage for vmmem

Steve Lo 135 Reputation points
2023-03-21T19:12:59.2566667+00:00

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

User's image

User's image

User's image

User's image

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

12 answers

Sort by: Oldest
  1. 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.

    Was this answer helpful?

  2. 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.

    Was this answer helpful?

  3. Fabio Antunes 5 Reputation points
    2023-12-05T03:10:28.4066667+00:00

    Just had this problem and the only way to fix it after having already quit the Docker Desktop app and without having to reboot, was running this in an elevated Powershell prompt (Run as Administrator):

    Restart-Service LxssManager
    

    Was this answer helpful?

    1 person found this answer helpful.
  4. Nicolas Vallet 20 Reputation points
    2023-12-18T10:25:41.0933333+00:00

    At my level, I noticed that I have Visual Studio open in remote mode to WSL2 + Docker, every time it occurs. Most of the time, it happens just after I wake up my laptop from sleep mode.

    If I shut down VS, who is trying to reconnect to the remote wsl session, shutdown docker, then shutdown WSL. Vmmem goes away and I can relaunch everything until the next time I put my laptop in sleep mode.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  5. Gagnon, Dominic 0 Reputation points
    2024-09-16T19:35:31.3633333+00:00

    Hi,

    I get this problem a lot; I have some information to share about this to help and I found a workaround: if you put your computer in hibernation and turn it on right after, depending on your root cause, Vmmem will drop near 0% of CPU usage where nothing running was killed in the process.

    I've linked the issue (for my part) to VS Code which (and this is documented to be intended this way) will take one core for the autocomplete feature which, when needed, will take 100% usage of this core. The problem is that running VS Code in Windows attached to WSL to work on a project under WSL's Ubuntu (in my case) will take one core in WSL to do its autocomplete job and it seems that WSL will let the related processes go over 100% CPU (wonder how this is possible) blocking all other process from running smoothly and impairing Windows to access WSL in any means. Once back from hibernation, the CPU usage drop, Windows is able to access the Linux subsystem again and everything goes back to normal.

    I don't understand why Linux processes can go over 100% (as seen with the top command) but I suspects that, under WSL the PC's cores are used as a single core under Linux and thus used entirely by VS Code's auto-complete processes.

    Here is a capture of one of the problematic processes as displayed by top before loosing the connection to the Linux subsystem:

    1833 user 20 0 1328476 107192 44936 S 124.7 0.3 214:56.97 /home/user/.vscode-server/bin/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/node

    Where 124.7 is in top's %CPU column.

    Was this answer helpful?