WSL: Vmmem.exe high CPU Usage

Update: I noticed that the Vmmem.exe popped up with a high CPU Usage after the docker installation with the WSL but I found a solution after some research.

You need to restart the WSL and in addition to avoid this problem in future, you can create an config file as below:

If you open Windows Power Shell, type below command which will restart the WSL:

Restart WSL

wsl --shutdown

Configuration file

By creating an config file, we can disable this issue. This file need to be created as it doesn’t exist usually. Open an text editor and add the 2 lines as below, save it in the folder:

/Users/USERNAME/         

file name:        .wslconfig

[wsl2]
guiApplications=false

Note: save the file as .wslconfig (don’t forget the dot in front of it, and make sure you don’t save it as txt extension file.

Restart.

Note: Additional read, the official Microsoft documentation on this config file.