It's careful attention to detail like this that keeps Linux relevant for the next generation!
(I'm kidding, of course. I was recently trying to reproduce some Node test flakiness that only happened on CI, which has limited resources and exposes timing sensitivity. I had trouble getting this to happen on my 32 core workstation, so I decided to run 100 copies of the tests in parallel which definitely reproduced the issue -- and ran the machine out of memory. The OOM killer kicked in, and chose to kill all the extra Node processes without killing my SSH session, which was nice of it.)
Yeah, I wonder why this happens. I've seen LKML emails trying to address this problem, they even cited Firefox as an example:
https://lkml.org/lkml/2019/8/4/15
This also seems to be the norm in user space software. I've read a lot of source code where people simply assume malloc never fails. Tried to discuss this on freenode once, apparently nobody knows what to do in case the system is out of memory. Why can't it gracefully degrade?
You mean install it by default? Even good old Debian stable ships with earlyoom (which I'm ofc using, since I saw it mentioned here once on HN).
It sounds odd to me to describe applications relying on a toolkit like QT/GTK which can run in dozens of different environments which in turn run on both X11 and Wayland which in turn can talk to a variety of different GPU drivers as tightly coupled.
I have left firefox overnight and had a tab decide it would like to eat all my memory.
Linux does have an oom killer to deal with out of memory situations but it will kick in halfway to the heat death of the universe and you will reboot first.
Oom looks just like a crash the UI is frozen however if the offender is killed everything actually is working.
The solution is a userspace oom daemon like earlyoom that kicks in before you actually run entirely out of memory and knows not to kill things like X.
Distributions ought to ship with it.