OOM killer

The part of the Linux kernel that kills a process when memory runs out.

It kills processes without warning, and without limits it can kill the wrong service.

In more detail

OOM stands for out of memory. When a control group reaches its memory limit, or the whole host runs out, the kernel picks a process and kills it with SIGKILL so the rest can survive. In Docker this shows up as a container that exited with code 137 and OOMKilled set to true in docker inspect. On a host with no limits, the victim may be a different service from the one that leaked.

Examples

docker inspect -f "{{.State.OOMKilled}}" mycontainer
kubectl get pod web -o jsonpath=.status.containerStatuses   # reason OOMKilled, exit code 137
A Node.js process can also die from V8's own "JavaScript heap out of memory" error when the heap reaches --max-old-space-size, before the kernel is involved.

Related terms

Taught in

References

Certification courses