Stopping Vmmem from using RAM

Viewed 71465

I am using Docker to run some containers on Windows 10, and when I was done I noticed an application named vmmem was using almost all of my ram: ~12GB. According to this it is because of Docker and it said if I closed all docker images and containers it would stop. So I stopped and removed all Docker containers and images by the following batch file:

@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i

from: https://gist.github.com/daredude/045910c5a715c02a3d06362830d045b6

so when you type docker container ls -a & docker image ls -a they both show nothing. However in Task Manager I still see vmmem using about 4 GB of RAM. What else can I do to stop this? Thanks.

6 Answers

I found the simplest and easiest way to shut down Vmmem is to go into Windows powershell / cmd and enter: wsl --shutdown. This shuts it down.

Create a %UserProfile%\.wslconfig file, and add the following configuration to it:

[wsl2]
memory=6GB # How much memory to assign to the WSL2 VM.
processors=5 # How many processors to assign to the WSL2 VM.

Then restart WSL2, by running the following command in PowerShell:

Restart-Service LxssManager

Source: https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-18945

Try this way

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

enter image description here

Go to Run > Type "services"

Find docker and click stop

Right Click Menu for Docker Desktop Service in Services Window with Stop hovered

I had a similar issue when I installed docker and realized it was using a lot of ram even when I was not using docker at that moment.

To mitigate this I had to disable docker auto startup such that I only use it when needed instead of auto-starting and running in the background even when not being used:-

  1. Open the Docker panel and go to settings, disable start docker desktop when u log in. The docker vmem process will not auto start next. it will start when you open docker.

enter image description here

Related