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

12 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,526 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. 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.


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.