2

Swap memory is limited to 4GB. How do I increase this?

enter image description here

enter image description here

1 Answer 1

2
  1. You can directly edit the %userprofile%\AppData\Roaming\Docker\settings.json file, for example, by setting "SwapMiB": 8192. After making changes, restart Docker.

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

Source

3
  • On a Mac, it is at ~/Library/Group Containers/group.com.docker/settings.json Commented Aug 29 at 7:40
  • @mindlessgreen docs.docker.com/desktop/settings/mac
    – YassineLbk
    Commented Aug 29 at 9:51
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.