Last active
April 27, 2026 12:57
-
-
Save karthiks/0d2efd28819cf3c17a6a9c1ab9389e33 to your computer and use it in GitHub Desktop.
Sample WSL Config to balance Docker on Windows resource utilization with host machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This .wslconfig can be found in your windows host @ C:\Users\{your-user}\.wslconfig | |
| [wsl2] | |
| localhostForwarding=true | |
| # default memory limit is 50% of available memory (setting higher limit might slow down your host performance) | |
| memory=10GB | |
| # Sets the amount of swap space (virtual memory on disk) | |
| # This acts as a safety net if your containers spike | |
| swap=4GB | |
| # Limits the number of CPU cores (optional, but helps host stability) | |
| processors=4 | |
| # Forces WSL2 to release memory back to Windows more aggressively | |
| autoMemoryReclaim=gradual |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment