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
- Stop WSLOpen Command Prompt or PowerShell and run
wsl --shutdown. Vmmem disappears or shrinks within seconds. - Limit WSL resourcesCreate
C:\Users\<you>\.wslconfigwith the settings below, then runwsl --shutdownto apply. - Check inside WSLRun
toporhtopin your Linux distro to find heavy processes. - Close Docker and VMsQuit Docker Desktop from the system tray and shut down Hyper-V VMs or Windows Sandbox when not in use.
- Update WSLRun
wsl --updatefor 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.
Keeping it from coming back
Keep the .wslconfig limits and shut down WSL when you finish work.
