Skip to content

Instantly share code, notes, and snippets.

@lucagrandicelli
Last active October 19, 2023 14:51
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lucagrandicelli/6561ab4c6874d2869a6f6e9f7f50adf2 to your computer and use it in GitHub Desktop.
Save lucagrandicelli/6561ab4c6874d2869a6f6e9f7f50adf2 to your computer and use it in GitHub Desktop.
WSL Memory Cap - Limit CPU/Memory When using Docker
# turn off all wsl instances such as docker-desktop
wsl --shutdownnotepad "$env:USERPROFILE/.wslconfig"
[wsl2]
memory=3GB # Limits VM memory in WSL 2 up to 3GB
processors=4 # Makes the WSL 2 VM use two virtual processors
#credits: https://itnext.io/wsl2-tips-limit-cpu-memory-when-using-docker-c022535faf6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment