Docker Community Forums

Share and learn in the Docker community.

Why does the host kernel panic with OOM, when my docker runs out of its alloted memory limit

Docker version:
Docker version 19.03.0-rc3, build 27fcb77

OS Version: Debian Stretch

Kernel version: Linux sonic 4.9.0-11-2-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 GNU/Linux

As per the docker documentation is we start a docker with -m --memory-swap=, upon hitting the limit, the container is expected to be killed due OOM (when --oom-kill-disable is not specified). I see that instead my host kernel panics. This should not be the case. What am I doing wrong.

If a limit is set on a container, it will be oom killed. I had oom kills a lot when tweaking the limits, without kernel panic.

Is there a reason that you use a release candidate of docker 19.03 instead of the latest docker-ce version from the docker repos?

Thanks for your response. The rc3 version was installed based on our build rules. I retried updating that version to: Docker version 19.03.12, build 48a66213fe, but see the same behavior (that is, kernel panics).

I tried some of the below settings on the host.

/proc/sys/vm/panic_on_oom # (0) Dont panic the kernel instead start the OOM killer thread.
/proc/sys/vm/overcommit_memory # (2) Don’t over commit the physical memory
/proc/sys/vm/overcommit_ratio. # (90) 90% of system memory

With this set, I saw that the application inside the docker gets killed, but not the docker itself. This is not the documented behavior though, as you mentioned.