Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Systemd's Out of Memory killer kills every process in scope (github.com/systemd)
11 points by ok123456 on Nov 14, 2022 | hide | past | favorite | 4 comments


Is systemd having an OOM killer really needed given that the kernel already does this? And if you have systemd doing OOM killing, would that also be competing with the kernel doing the same thing?

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:

https://github.com/facebookincubator/oomd

https://www.phoronix.com/news/Ubuntu-22.04-Systemd-OOMD


Poettering tagged this as Request for Enhancement. i.e. it's currently working as designed.


We need to launch more processes so we can KILL THEM TOO! psychopath eyes


Wow, 1.8K open issues ...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: