Swap memory is limited to 4GB. How do I increase this?
1 Answer
You can directly edit the
%userprofile%\AppData\Roaming\Docker\settings.json
file, for example, by setting"SwapMiB": 8192
. After making changes, restart Docker.If you installed Docker with the
WSL 2
backend (the default option), you need to create a.wslconfig
file in your user directory. The file should have the following structure:
[wsl2]
memory=19GB # Limits VM memory in WSL 2
swap=110GB
-
On a Mac, it is at
~/Library/Group Containers/group.com.docker/settings.json
Commented Aug 29 at 7:40 -
-
After updating the settings.json and restarting docker, I see that the container still crashes as soon as it exceeds physically available RAM. So it doesn't seem like it's using the specified swap memory. Commented Aug 29 at 13:02