Earlyoom – Early OOM Daemon for Linux
github.com
github.com
But since chrome should survive a tab dying, just killing an individual tab should be a perfectly good strategy in most cases.
Otherwise, it's very likely that Chrome is more important than other processes running on the system, in any use case where a heavily used Chrome is present, isn't it? You won't have Chrome with a thousand tabs on a server system, and if you're running something like a massive compilation, you probably just want it to fail if it can't fit in RAM, not kill the whole Chrome process group to continue.
They aren't saying they want to kill all of chrome. They're saying that in order to know that the problem is that chrome is using all of the memory in order to decide to kill a single chrome tab, the daemon needs to be able to identify that all of the processes belong to one program (chrome).
Another instance of this is a shell fork bomb - your memory is used up but each individual fork uses very little and killing the largest process won’t help.
Anytime I can consume my 64G of ram, I was probably doing something stupid anyway.
XSuspender - Automatically suspend inactive X11 applications When an application window loses focus, XSuspender tries to match it to one of the rules in its configuration. If a match is found, the application is sent a SIGSTOP signal (preventing the process from obtaining further CPU time). Upon windows regaining focus, the process is seamlessly continued where it had left off.
The answer for both of those is "if you're unfortunate enough to be running a 2.6 kernel linux server from 2005, then you can't use cgroupsv2 and thus can't use oomd or systemd-oomd".
That is the only thing earlyoom is good for at this point I think, is old systems without cgroupsv2
And it doesn't help in thrashing in Linux, it does it anyway.
[0] https://chrisdown.name/2018/01/02/in-defence-of-swap.html
Still the question is open, what does swap do for me in 2023? I only see disadvantages.
Of course the remedy is to have no or very little swap configured, but that's not obvious when compared to other operating systems (for example on Windows more swap never hurts, and the system recovers very quickly once memory pressure is gone)
My guess is that something causes a kernel panic, like the filesystem getting itself into trouble with the hardware.
In fact it has been completely fine for me to remove it.
The time I wasted having to kill orphaned processes and restarting everything, daily, was easily greater than the hard resets, which happen like once a year or so to me.
I'd love a setting on Linux to tell it to treat executable pages memory-mapped from disc as Really Important and never evict them. It'd have to come with a suitable warning that if you set this then you get exactly what you deserve, but TBH it probably is what most people actually think is happening already and want.
Disabling swap is a very coarse optimization. The ultimate problem is performance. If you have 16GB RAM + 10GB of stuff sitting completely idle, that works perfectly fine. If you have 16GB RAM + no swap + a process that requires 15GB RAM and uses all of that constantly, it's going to be painful, as the kernel tries to compensate by squeezing memory out of anywhere it can, over and over.
Even worse when it kills containers.