High CPU usage for vmmem

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

15 answers

Sort by: Most helpful
  1. Limitless Technology 44,021 Reputation points
    2023-03-22T14:19:50.54+00:00

    Hello

    Thank you for your question and reaching out. I can understand you are having query\issues related to vmmem high CPU usage.

    When Docker is running, it uses memory just like any other virtual machine in any virtualizer. Docker is a sort of virtual machine.

    It suggests that you create the following text file at:

    C:\Users<your-username>.wslconfig

    [wsl2]

    memory=2GB # Limits VM memory in WSL 2

    processors=1 # Makes the WSL 1 VM use two virtual processors

    Reference :

    https://devblogs.microsoft.com/oldnewthing/20180717-00/?p=99265

    --If the reply is helpful, please Upvote and Accept as answer--


  2. Antonio Torres Vargas 0 Reputation points
    2023-09-13T14:57:56.0433333+00:00

    This worked for me.

    Create the following text file at:

    C:\Users<your-username>.wslconfig

    [wsl2]                                                                           
    guiApplications=false
    

    then restart the PC

    0 comments No comments

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


  4. Jiri Hajek 20 Reputation points
    2023-09-21T06:59:58.25+00:00

    Just fyi, while I had several instances of this issue in the past, it doesn't happen anymore, haven't had it in the past months. Not sure what changed, my PC usage seems to be pretty much the same, so possibly some of the updates.

    0 comments No comments

  5. Thomas Arand 0 Reputation points
    2023-11-08T07:48:51.26+00:00

    I have the same issue.
    Sometimes docker is running, sometimes not (So docker alone does not seem to be the only app causing this behaviour).
    However, restarting the PC is not a solution.
    Unfortunately, sometimes "wsl -shutdown" doesn't work (the command simply doesn't return, and the high mem/CPU usage of VMMEM is still there).
    Any other ideas to workaround?

    0 comments No comments