Systemd's Out of Memory killer kills every process in scope
github.com
github.com
https://www.kernel.org/doc/gorman/html/understand/understand...
The kernel's OOM killer can be annoying and complicated sometimes, but I do like it since I can easily change /proc/${PID}/oom_score_adj to prevent it from killing something important.
EDIT: Per the docs:
systemd-oomd is a system service that uses cgroups-v2 and pressure stall information (PSI) to monitor and take corrective action before an OOM occurs in the kernel space.
https://www.freedesktop.org/software/systemd/man/systemd-oom...I'd be really interested in a more thorough explanation about the justification for it. This makes it seem like a bad thing that this is happening in the kernel, but memory management is the kernel's job and there would be less overhead than in userspace. Personally I think OOMScoreAdjust that systemd I think has provided a long time is the best approach for this, since it's not duplicating functionality and gives you a more user-friendly way to maintain the oom score without messing around with /proc.
Another fun fact, it also seems to kill based on what it determines to be excessive swap usage.
https://askubuntu.com/a/1423840
Facebook also wrote its own oom daemon, that systemd's was forked from: