Out-of-memory victim selection with BPF
Out-of-memory victim selection with BPF
Posted Aug 17, 2023 18:33 UTC (Thu) by roc (subscriber, #30627)In reply to: Out-of-memory victim selection with BPF by rrolls
Parent article: Out-of-memory victim selection with BPF
Handling OOM "gracefully" in application code just doesn't make sense for most applications. In almost every case you simply cannot proceed and might as well just treat it the same as a crash, power-down, or other process-kill, in which case just killing the process at the point of OOM is much much simpler than having code to propagate errors up the stack until you get to some handler that does effectively the same thing.
And even when there is something other than just exit that you'd like to do for OOM, it's really hard to implement. You have to do whatever it is without allocating more memory, which is often impossible. When it is possible, you have to thoroughly test these code paths, which is more hard work. It's hardly ever worth it.
