3 ms·
Not all systems have overcommit enabled. Notably, as the article linked above points out, robust systems do not have overcommit enabled. The OOM killer is heuri
by AndyKelley 11y ago
Not all systems have overcommit enabled. Notably, as the article linked above points out, robust systems do not have overcommit enabled. The OOM killer is heuristics based and cannot be relied on in robust systems. This means that libraries and applications that want to be viable on such platforms have to recognize that malloc may return NULL and respond accordingly.
- EmanueleAina 11y agoVery true for low-level system libraries, but applications should really not waste energy on trying to be OOM-safe: it's hard to understand which actions are safe when you no longer can allocate memory (releasing resources often requires allocating memory temporarily), and it just adds complexity which basically will never get tested, thus getting broken quickly and gaining nothing over just crashing on a NULL dereference. See the experience of the D-Bus (which tries hard to be OOM-safe) on this topic: http://blog.ometer.com/2008/02/04/out-of-memory-handling-d-bus-experience/ http://blog.ometer.com/2008/02/04/out-of-memory-handling-d-b...