Run wsl --shutdown to stop WSL and free the memory immediately. To cap it permanently, create %UserProfile%\.wslconfig with a memory= and processors= limit, and quit Docker Desktop or VMs when not needed.

What Vmmem actually means

Vmmem isn’t a normal program. It’s how Task Manager shows the resources reserved by the virtual machine platform. WSL 2 by default can use up to half of your RAM (or 8 GB on some versions) and caches files in memory, so Vmmem can look huge after builds or Docker workloads.

Newer WSL versions return memory more gradually (“autoMemoryReclaim”), but setting limits in .wslconfig is the dependable fix.

How it shows up

  • Task Manager shows Vmmem or VmmemWSL using several GB of RAM or high CPU.
  • PC slows down while Docker or WSL is running.
  • Memory stays high after Linux tasks finish.

Common causes

  • WSL 2 distributions or Docker Desktop running.
  • Linux file caching inside WSL.
  • Hyper-V VMs or Windows Sandbox open.
  • Runaway processes inside the VM.

How to fix it, step by step

  1. Stop WSLOpen Command Prompt or PowerShell and run wsl --shutdown. Vmmem disappears or shrinks within seconds.
  2. Limit WSL resourcesCreate C:\Users\<you>\.wslconfig with the settings below, then run wsl --shutdown to apply.
  3. Check inside WSLRun top or htop in your Linux distro to find heavy processes.
  4. Close Docker and VMsQuit Docker Desktop from the system tray and shut down Hyper-V VMs or Windows Sandbox when not in use.
  5. Update WSLRun wsl --update for memory-reclaim improvements.

Command

[wsl2]
memory=4GB
processors=2
swap=2GB

Save this text as .wslconfig in your user folder (C:\Users\YourName\.wslconfig), then run wsl --shutdown. Adjust the numbers to your PC.

Check it's fixed: Vmmem stays under the memory limit you set while WSL/Docker is running.

Keeping it from coming back

Keep the .wslconfig limits and shut down WSL when you finish work.