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,697 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,579 questions
{count} votes

17 answers

Sort by: Most helpful
  1. Walker, James (SI BP AM R&D SYS) 60 Reputation points
    2023-07-17T13:47:30.0733333+00:00

    Open cmd prompt, run as admin,

    wsl --shutdown
    
    12 people found this answer helpful.

  2. WFarmer 40 Reputation points
    2023-06-07T15:54:52.5933333+00:00

    Hi All,

    I use Docker and WSL2 frequently and have run into this problem many times. It seems to happen semi-randomly after some period of time, ~1-2 days.

    I don't have a solution that addresses the core issue with Vmmem but I do have a workaround that doesn't require rebooting my whole machine. For me, going into Task Manager and ending the "Windows Subsystem for Linux" task is sufficient and Vmmem goes back to normal.
    User's image

    Hope this works and saves people from having to restart every time.

    8 people found this answer helpful.

  3. Petr Bodnár 30 Reputation points
    2023-07-23T10:22:01.23+00:00

    Note that this bug seems to have been discussed at https://github.com/microsoft/WSL/issues/6982 for over 2 years already. From there, it looks like pressing Win+Ctrl+Shift+B could also help, as it resets the graphic (video) driver which apparently causes the issue.

    As stated by WFarmer, stopping the Window Subsystem for Linux (wslhost.exe) should work as well. In the linked thread, restarting the Windows service called WslService could help as well.

    Of course, none of this helps with avoiding the issue altogether, unfortunately.

    5 people found this answer helpful.
    0 comments No comments

  4. Nicolas Vallet 10 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.

    2 people found this answer helpful.
    0 comments No comments

  5. Steve Lo 110 Reputation points
    2023-03-22T19:18:54.26+00:00

    Thanks for your answer, it's probably fix the symptom by scarifying the performance. However, any idea what is the root cause or how to figure it out? Particularly high cpu with unresponding Ubuntu and no docker running?

    1 person found this answer helpful.

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.