Skip to content

Instantly share code, notes, and snippets.

@raaghulr
Created March 8, 2022 14:53
Show Gist options
  • Save raaghulr/456968bbcc9e7ed037adf2f0818b7b13 to your computer and use it in GitHub Desktop.
Save raaghulr/456968bbcc9e7ed037adf2f0818b7b13 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