I use an application that uses a lot of memory, and sometimes that crashes my desktop. So I installed earlyoom
. When I test from a terminal, it works as expected:
Terminal 1
$ earlyoom
Terminal 2
$ tail /dev/zero
I see the RAM usage growing, and when it is close to the limit, it gets killed.
However running it as a systemd service, and repeating the same test leads to a desktop crash like before. The systemd service seems to have started correctly, so I’m not sure what’s wrong:
$ journalctl -b -1 -u earlyoom
Feb 10 11:53:36 host systemd[1]: Started Early OOM Daemon.
Feb 10 11:53:36 host earlyoom[955]: earlyoom 1.6.2
Feb 10 11:53:36 host earlyoom[955]: Notifying through D-Bus
Feb 10 11:53:36 host earlyoom[955]: Preferring to kill process names that match regex '^(Web Content|Sparrow|Bisq)$'
Feb 10 11:53:36 host earlyoom[955]: Will avoid killing process names that match regex '^(dnf|packagekitd|gnome-shell|...)$'
Feb 10 11:53:36 host earlyoom[955]: mem total: 13830 MiB, swap total: 8191 MiB
Feb 10 11:53:36 host earlyoom[955]: sending SIGTERM when mem <= 3.62% and swap <= 10.00%,
Feb 10 11:53:36 host earlyoom[955]: SIGKILL when mem <= 1.81% and swap <= 5.00%
Feb 10 13:16:44 host earlyoom[955]: mem avail: 76 of 13830 MiB ( 0.55%), swap free: 754 of 8191 MiB ( 9.21%)
Feb 10 13:16:44 host earlyoom[955]: low memory! at or below SIGTERM limits: mem 3.62%, swap 10.00%
Feb 10 13:16:44 host earlyoom[955]: memory situation has recovered while selecting victim
This is from one of the tests. Not all of them have the last 2 lines: “low memory! …”. Is it possible the tail /dev/zero
test leads to oom too fast for earlyoom
to respond? How come it works when I do it interactively? Thoughts?