Artificial intelligent assistant

What is the Out of Memory message: sacrifice child? My computer recently ran out of memory (a not-unexpected consequence of compiling software while working with large GIS datasets). In the system log detailing how it dealt with the OOM condition is the following line: Out of memory: Kill process 7429 (java) score 259 or sacrifice child What is that `or sacrifice child` about? Surely it isn't pondering some dark ritual to keep things going?

From source files I found oom_kill.c, the OOM Killer, after such message is written in system log, checks children of the process identified and evaluates if possible to kill one of them in place of the process itself.

Here a comment extracted from source file explaining this:


/*
* If any of p's children has a different mm and is eligible for kill,
* the one with the highest oom_badness() score is sacrificed for its
* parent. This attempts to lose the minimal amount of work done while
* still freeing memory.
*/

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5d500787f688d32c84efb9c3d71993da