Increasing WSL2 memory limits

Go to user’s folder:

cd %UserProfile%

create .wslconfig file with the following content:

[wsl2]
memory=30GB
swap=10GB

and restart WSL in PowerShell:

wsl --shutdown

Ensure the changed was applied:

free -h
               total        used        free      shared  buff/cache   available
Mem:            29Gi       639Mi        28Gi       3.4Mi       145Mi        28Gi
Swap:           10Gi          0B        10Gi

1 Response to Increasing WSL2 memory limits

  1. dmitriano says:

    Advanced settings configuration in WSL
    https://learn.microsoft.com/en-us/windows/wsl/wsl-config

Leave a Reply to dmitriano Cancel reply

Your email address will not be published. Required fields are marked *