Skip to content

Instantly share code, notes, and snippets.

@karthiks
Last active April 27, 2026 12:57
Show Gist options
  • Select an option

  • Save karthiks/0d2efd28819cf3c17a6a9c1ab9389e33 to your computer and use it in GitHub Desktop.

Select an option

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 .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