Limit memory used by WSL
- In Windows, open ~/.wslconfig
- Add the following contents:
[wsl2]memory=6GB # Limits VM memory in WSL 2 up to 6GB
- Save and exit.
- Restart WSL to get a new configuration.
- Lunch a new PowerShell and run the following command: