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. Pantsleftinwash 5 Reputation points
    2024-10-17T14:06:03.73+00:00

    I get this on win10 + WSL2 - When wsl --shutdown fails, from an admin powershell you can beat wsl to death with Get-Process | Where-Object { $_.Name -like "wsl*" } | Stop-Process

    1 person found this answer helpful.

  2. Limitless Technology 44,371 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--


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

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


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

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.