-1

Simple question, I created a WSL2 instance on 8Gb of RAP laptop and immediately saw the memory usage increase to 6Gb with no process taking that much memory (including all process combined) :

enter image description here

Obviously this sounds like to be a VM issue.

I started by trying to delete the VM instance, and even went to try to disable hyperV, but the memory usage problem when no foreground application is running persists.

Giacomo1968
  • 58,727
user2284570
  • 2,020

1 Answers1

0

Is it actually an issue? Unless you notice adverse effects while running WSL2, consider it normal operation. A virtual machine has memory pre-allocated for it, i.e., so much memory is reserved for WSL2, and the remainder is usable by non-VM processes.

However, if you do find problems caused by excessive memory use, then simply shut WSL2, or allocate less memory to it using .wslconfig. For example, to divide RAM 50%/50% between real and virtual processes from your PC's 8 GB RAM,

to the file.

  • Reboot WSL2 from CMD with wsl --shutdown, or completely reboot the PC.

Now memory should (approximately, because of interpretation of GB decimal or as a power of two) be allocated 4 GB for WSL2, and 4 GB for the real machine.