High CPU usage for vmmem

Steve Lo 110 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 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,744 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,617 questions
{count} votes

17 answers

Sort by: Most helpful
  1. Stéphane Tremblay 0 Reputation points
    2024-04-04T18:43:04.1866667+00:00

    I am getting this issue as well where VMmemwsl starts progressively using more and more CPU until it reaches 100% all while doing nothing in my WSL Ubuntu.

    However, I noticed this only happens when I am connected to our corporate Citrix Secure Access VPN, in which case I cannot access the internet. As soon as I disconnect from the VPN, CPU usage drops back down to normal.

    All of you who had the CPU spike issue, can you all please check if networking or internet access from WSL has anything to do with the spike?

    I hope this helps.


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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.