FacebookTwitterLinkedIn

How to Fix Vmmem High Memory Usage

How to Fix Vmmem High Memory Usage on Windows 11

The Vmmem/VmmemWSL process is part of the WSL (Windows Subsystem for Linux) virtual machine software. Many WSL users notice that Vmmem consumes a lot of memory and CPU resources that are sometimes difficult to justify. This article will explain this issue in more detail and show several ways to reduce or eliminate Vmmem high memory/CPU usage.

Vmmem High Memory Usage

What is Vmmem in Task Manager?

As previously mentioned, Vmmem/VmmemWSL is a process that is part of the WSL (Windows Subsystem for Linux) virtual machine. Vmmem is a virtual process that your system uses to represent your virtual machine’s memory and CPU resources in Task Manager.

Therefore, if you see that Vmmem consumes a lot of your system’s memory or CPU, it means that your virtual machine is doing it.

What Causes Vmmem High Memory/CPU Usage?

  • WSL’s high memory and CPU usage is normal. WSL is configured to reserve up to 80% of your system’s available memory. However, contemporary Windows versions have lowered this to 50% and no more than 8GB.
  • WSL runs a lot of processes. If you run a lot of resource-intensive processes on your virtual machine, the memory and CPU usage will also increase. Closing some unnecessary processes can reduce resource usage.
  • Too much memory/CPU resources were allocated for your virtual machine. If you have allocated too much memory or CPU cores to your virtual machine to have more capacity for when you need it, you should know that your virtual machine can use more resources than it would otherwise.
  • Docker Desktop memory leak. Some users have suggested that the Docker Desktop eats up memory over time. Restarting WSL will reduce resource hogging temporarily. A better solution is to limit memory and CPU usage by WSL.

Video Tutorial on How to Fix Vmmem High Memory Usage

Table of Contents:

Method 1. Shut down WSL (Windows Subsystem for Linux)

If you don’t use WSL 1/2 all of the time, you can shut it down. Shutting it down will also end the Vmmem process.

1. Hold down Windows+R keys to open Run.

Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator

2. Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator.

Run wsl --shutdown command

3. In the PowerShell window, type in:

wsl --shutdown

4. Press the Enter key. Executing this command will terminate all running WSL distributions.

[Back to Table of Contents]

Method 2. Restart WSL (Windows Subsystem for Linux)

WSL provides virtualization solutions for Windows but can cause high memory and CPU usage that the Vmmem process visualizes in Task Manager. Sometimes, you can reduce excessive resource usage by restarting WSL.

1. Hold down Windows+R keys to open Run.

Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator

2. Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator.

Run the wsl.exe -l -v command, select a distribution to terminate and run wsl.exe -t DistributionName command to terminate it

3. In the PowerShell window, type in:

wsl --shutdown

4. Press Enter. Executing this command will terminate all running WSL distributions. Launching any distribution will restart WSL.

5. If you want to shut down a specific distribution, type in:

wsl.exe -l -v

6. Press Enter. A list of all running and stopped distributions on your system will appear.

7. Then, type in:

wsl.exe -t DistributionName

8. Press Enter to terminate the chosen distribution.

9. To restart a specific distribution, type in:

wsl.exe -d DistributionName

10. Press Enter to restart the distribution.

[Back to Table of Contents]

Method 3. Limit WSL (Windows Subsystem for Linux) Memory and CPU Usage

If you don’t want to shut down WSL, you can put a cap on how much memory and CPU cores it can use so that it doesn’t overburden your system with resource-hogging. However, you can only do this with WSL 2, which works on Windows Builds higher than 19041.

1. Hold down Windows+R keys to open Run.

2. Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator.

Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator

3. In the Powershell window, type in:

wsl --shutdown

4. Press the Enter key to execute the command.

5. Close PowerShell and open WSL.

Run the editor

6. In the WSL window, type in:

editor "$(wslpath "C:\Users\YourUsername\.wslconfig")"

7. Press Enter.

Typoe in [wsl2], memory=2GB, processors=2 in the WSL window

8. Then, type in:

[wsl2]

memory=4GB

processors=2

This will limit your WSL virtual machine to using the memory size and number of virtual processes specified. Set the limit according to your RAM size.

9. Hold down Ctrl+X keys.

10. Press the Y key when prompted to save the changes.

Press Enter to confirm the location

11. Press Enter to confirm the location.

12. Close the WSL window.

13. Hold down Windows+R keys to open Run.

Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator

14. Type powershell in the Run dialog and hold down Ctrl+Shift+Enter keys to open PowerShell as an administrator.

Run the wsl --shutdown command

15. In the Powershell window, type in:

wsl --shutdown

16. Press the Enter key to execute the command.

17. Close PowerShell and open WSL again.

Run the free -h --giga command

18. To confirm that the resources were allocated successfully, type in:

free -h --giga

19. Press Enter.

Did this article help you fix Vmmem high memory/CPU usage on your PC? Let us know in the comments below.

[Back to Top]

▼ Show Discussion

About the author:

Rimvydas Iliavicius

Rimvydas is a researcher with over four years of experience in the cybersecurity industry. He attended Kaunas University of Technology and graduated with a Master's degree in Translation and Localization of Technical texts. His interests in computers and technology led him to become a versatile author in the IT industry. At PCrisk, he's responsible for writing in-depth how-to articles for Microsoft Windows. Contact Rimvydas Iliavicius.

Our guides are free. However, if you want to support us you can send us a donation.

About PCrisk

PCrisk is a cyber security portal, informing Internet users about the latest digital threats. Our content is provided by security experts and professional malware researchers. Read more about us.

Malware activity

Global malware activity level today:

Medium threat activity

Increased attack rate of infections detected within the last 24 hours.