I installed docker on windows home which uses WSL2 as a backend. However, since doing this a process called vmmem seems to be consistently consuming a lot of computational resources. I ran docker stop $(docker ps -aq) to kill all running containers (there were 12 - oops) which has improved the issue significantly. However, even after closing docker down vmmem is still taking ~1.5 - 2Gb of ram and ~20% CPU. Since there are no longer any containers running, shouldn't the resource consumption of vmmem be minimal? How can I reduce the consumption of the vmmem process?

  • 6
  • 1
    Looks like this is a known issue and people are working on it. I'll wait for the fix. Thanks for the link. Jun 11, 2020 at 9:02
  • I found this article after seeing that WSL was using 11GB of memory. A few minutes later, and just before I went to disable WSL, it had dropped to 1.3 GM of memory usage. I had just done a Windows update and restart, so I presume that it had some paperwork to do and then released the resources it needed. Long story short, give it 10 minutes before turning it off, especially if you use WSL even occasionally. Aug 29, 2023 at 13:11

14 Answers 14


Daniiel B is on the money. To turn off Vmmem simply go into Powershell or whatever terminal you like to use under admin rights and enter the command wsl --shutdown, when your done with playing in wsl1/2.

  • 83
    this doesn't answer the question - I need my dockers to run, but I just want to bound the RAM consumption Nov 1, 2020 at 16:45
  • 5
    That pretty much answer your question. For as long as you use docker (or anything using WLS2 as the backend), you'll see vmmem consuming your RAM. If you run your dockers, vmmem will be there. Mar 29, 2021 at 14:25
  • Docker generate error over unexpected shutdown, is there any better way to turn it off? Aug 23, 2021 at 9:02
  • As of 10/2022 there is yet to be an official fix from Microsoft for this problem. Looks like this is still the best "solution." Oct 13, 2022 at 14:21
  • When you kill wsl through wsl --shutdown after few minutes your docker desktop process using WSL as backend is killed, and vmmem process is also killed. So, clearly vmmem is linked with WSL
    – srk
    Apr 29, 2023 at 4:01

I edit the WSL config to limit the memory usage as mentioned here.

# turn off all wsl instances such as docker-desktop
wsl --shutdown
notepad "$env:USERPROFILE/.wslconfig"

Set the values you want for CPU core and Memory:

memory=3GB   # Limits VM memory in WSL 2 up to 3GB
processors=2 # Makes the WSL 2 VM use two virtual processors
  • 6
    This is also a great answer or should be part of core answer. Capping VM limit helps to keep your system usable.
    – bgs
    Mar 29, 2023 at 20:18
  • 9
    This should be the accepted answer May 3, 2023 at 11:50
  • 1
    Does this file have to be created? Or should I find it already existing?
    – Sandburg
    Jul 6, 2023 at 7:52
  • 1
    As of last month, you can add experimental.autoMemoryReclaim=gradual to your .wslconfig so WSL gradually releases memory to windows Oct 18, 2023 at 1:23

vmmem even after docker has shut down, will run for a few seconds up to 1 minute before completely shutting off. So try shutting down your containers and docker and it should disappear soon enough.

The accepted answer talks about shutting down WSL (the windows subsystem for Linux) which makes sense if you actually opened and installed a distro, but since you mentioned about Docker, i'm guessing your vmmem is just showing the usage of docker containers only.

Here's a nice explanation from a trustworthy individual : https://devblogs.microsoft.com/oldnewthing/20180717-00/?p=99265


Considering the main question was about how to reduce the consumption of RAM, and since you're using docker; take a look at : Docker Resource Contraints

More specifically the --memory=2g parameter, you can limit the RAM a container will use, and in turn vmmem itself will use less RAM as well.

  • 8
    This works. Close Docker Desktop and after a minute, vmmem disappears from Task Manager.
    – Tonatio
    Apr 15, 2021 at 7:32
  • 3
    Similarly, a minute after closing all WSL terminals, vmmem goes away
    – Bob Stein
    Jul 29, 2021 at 19:28
  • 2
    Should be accepted answer.
    – T.Todua
    Oct 26, 2021 at 9:23
  • "Quit docker desktop" is the context menu option to choose when clicking the icon in the system tray. I also found that if the "vmms" service has been stopped manually the vmmem process will linger long after quitting docker, but starting the "vmms" service will actually terminate the vmmem process (or allow it to terminate).
    – StingyJack
    Dec 4, 2022 at 23:45
  • What if I'm using Rancher? I exited Rancher desktop and stopped the Rancher Windows service, and waited several minutes, yet vmmem persists. I must be missing something. Mar 22, 2023 at 14:31

Restart WSL2, by running the following command in PowerShell right click and run in Administrator mode:

Restart-Service LxssManager
  • Or wsl --restart
    – tejasvi88
    Jun 28, 2022 at 9:07
  • @tejasvi88 wsl --restart does nothing, it's not recognized argument
    – everis
    Jan 28, 2023 at 12:22
  • @everis - wsl --restart is not a Powershell parameter to Restart-Service LxssManager, if I understand you correctly? wsl --restart is a standalone command which can be invoked from a cmd shell, or a Powershell, if the system path knows where WSL lives.
    – user924272
    Jan 11 at 23:05

The memory is being consumed by Linux to cache files. It can be seen in the buff/cache section of free command. To drop the cache, simply run echo 3 | sudo tee /proc/sys/vm/drop_caches.

  • this is it. combining this cache clearing command with limiting WSL memory usage, I'm happy
    – Diego Lima
    Jan 23, 2022 at 11:26
  • This solution allow to free some RAM while keeping wsl / Docker up. I've added some detail.
    – 4wk_
    Apr 18, 2023 at 7:17

If you want to stop vmmem process, try this way

  1. open start menu -> find 'Hyper-V Manager' just by typing
  2. stop the virtual machine -> right-click -> turn off

enter image description here


I just created the %UserProfile%\.wslconfig file with these two lines and left everything else untouched. It worked fine.


I did a full shutdown right after adding the file for WSL to pick up the new settings.

$ wsl --shutdown

See additional information from Microsoft here: Advanced settings configuration in WSL

  • Tnx! This was all I needed, memory=4GB (on my 8GB machine )-; ) ... And of course wsl to restart it. Now, how did I get separate "terminal" windows with bash running before (not the powershell window)!? Thanks!
    – shellter
    Mar 22, 2023 at 23:19

This question was around 2 years old at the time I looked at it and was I was experiencing just now seeing the problems. Might be due to enabling Kubernetes inside Docker for Windows (I'm not sure about that).

I was able to shutdown the Windows Subsystem for Linux (WSL) using the wsl --shutdown command which did free memory but disabled the use of Docker.

So, I updated my ~/.wslconfig file (aka %USERPROFILE%\.wslconfig) as suggested to reduce memory. I believe that helped.

Later found out is my WSL subsystem was out of date and not being updated (by default) with Windows Updates because I had disabled Receive updates for other Microsoft products when you update Windows.

So I enabled that, and ran wsl --update (in admin shell), and my WSL version was updated from 3/16/21 (Kernel Version 5.4.72) to today (5/2/22) (Kernel Version

I'm hoping this will also help.

  • Any issues reducing memory via .wslconfig when kubernetes enabled? I'm up to 16GB usage in vmmem messing with devcontainers and local kubernetes. I'm also at version and just updated to - didn't realise it was manual update!
    – Andez
    Jan 26, 2023 at 14:12
  • I ended up disabling kubernetes due to some issues, I can't recall exactly what they were to answer your question. I also have a local (Linux based) kubernetes (K8S) environment so I don't need to use the Docker for Windows implementation of kubernetes. Most likely, it was memory related and I wanted to make sure the issue with docker using too much memory was fixed which it appears to be.
    – PatS
    Jan 27, 2023 at 16:27

In my case I do not have WSL installed but do have Docker. I had shut down the docker process ungracefully then noticed some time later that vmmem was using a lot of CPU. Windows did not allow me to kill the vmmem process.

I had to open Docker again and shut it down gracefully via the system tray icon. After that vmmem was no longer running at all.

  • Odd, I thought docker on windows only worked with WSL. Dec 4, 2020 at 23:28
  • I'm not an expert on the matter, but i did verify that Windows Subsystem for Linux is not checked in my Windows Features list. Dec 7, 2020 at 18:19
  • 1
    @CiaranWelsh it only works with WSL for Windows 10 Home, but for other systems like Windows 10 Pro or Enterprise it doesn't need WSL: docs.docker.com/docker-for-windows/install
    – dhasson
    Dec 27, 2020 at 20:57
  • That makes sense.. I'm on Win10 Enterprise. Dec 28, 2020 at 15:16
  • [Gracefully] closing Docker Desktop app worked for me.
    – truefusion
    Aug 31, 2022 at 12:11

According to this thread: https://github.com/microsoft/WSL/issues/6982, using memory setting in .wslconfig doesn't always work.

Solution seems to be to:

  1. Add this to \Users\<USERPROFILE>\.wslconfig (create the file if it doesn't exist)
  1. Restart wsl by running wsl --shutdown in powershell or command prompt (it says shutdown but it actually stops and restarts all running wsl distributions)

Could it relate to this????

For my issues, high CPU and high RAM usage by vmmem, I have tried all the solutions I could look up here and elsewhere for WSL2. It seems that for some types of tasks, WSL2 will eat up your memory and not spit it out when done...

Exceptions for using WSL 1 rather than WSL 2:

  • WSL 2's memory usage grows and shrinks as you use it. When a process frees memory this is automatically returned to Windows. However, as of right now WSL 2 does not yet release cached pages in memory back to Windows until the WSL instance is shut down. If you have long running WSL sessions, or access a very large amount of files, this cache can take up memory on Windows. https://docs.microsoft.com/en-us/windows/wsl/compare-versions

I don't need WSL2 for this specific task... I'm trying WLS1 now...

I'll post an update on how it goes...

Update: Shifting to WSL1, solves it for me when running many subprocesses, it seems. I have been running way past the time point where it overloads the RAM and comes to a halt.

  • 3
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Apr 23, 2022 at 9:39

Aside from WSL, the Android Subsystem could also be the culprit.


open cmd as Admin

net stop vmcompute
  • This command stops the local Hyper-V host computing service, so not sure how it is related. Could you explain? Also, this did not change the high CPU usage of vmmem on my machine.
    – Joël
    Sep 21, 2023 at 8:11

I had the same issue with Windows 10 Version 20H2 and OS Build 19042.1466 and creating the ".wslconfig" file as the guys told solved my problem. But my concern: is this solution like a memory suppression for the containers and made my container slow? Is there any idea regarding this memory usage? Is it a memory leakage? Or is it only memory reservation that Docker/WSL2 doing? I didn't face this issue in Windows 11 Version 22H2 and OS build 22621.1555 till now at least.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .