I have a device that has Debian 11 installed, on which Docker is running. On boot, it starts the Docker Daemon and the nine containers. Eight of them are executing a C# program and the last one is a Postgres one.
If I add vm.overcommit_memory = 2
to /etc/sysctl.conf
and reboot the device,
only the Postgres container starts.
After, I did these steps:
docker-compose down
- Set
vm.overcommit_memory = 2
- reboot
docker-compose up -d
Now, the first container, the Postgres one, fails to start with this error:
ERROR: for StargatePostgres Cannot start service postgres: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 2, stdout: , stderr: fatal error: out of memory allocating heap arena map
There is enough memory, that's for sure:
free -m
total used free shared buff/cache available
Mem: 3603 534 2557 20 511 2910
-
What are the memory requests of each of your containers? the kernel is thinking there isn't enough memory for an allocation postgres is requesting. link to overcommit docs at redhatPhil– Phil12/23/2024 19:00:35Commented Dec 23, 2024 at 19:00