-1

Machine

I have a dell XPS15 windows 11 laptop with wsl2 running ubuntu 20.05 LTS.

Windows

When I open settings > system > about, I see:

Installed RAM: 32.0 GB (31.8 GB usable)

WSL2

When I run htop in my wsl2-linux(ubuntu 20.04 LTS) terminal, I see:

Mem 15.5 G
Swp 4.00 G 

Questions

  1. Can I give wsl2-linux access to all my RAM ?

  2. If it is possible, how can I do it ?

  3. If not, what is the technical issue ?

Alex
  • 160
  • 11

1 Answers1

1

50 % memory is the default value. You can change it.

https://learn.microsoft.com/en-us/windows/wsl/wsl-config#global-configuration-options-with-wslconfig

Run wsl --shutdown to shut down any active instances. Edit .wslconfig in your profile directory with e.g.

[wsl2]
memory=30GB

then start wsl again.