In oom_kill.c, one of the badness calculations is wildly inaccurate. If memory is shared among child processes, that same memory will be counted for each child, effectively multiplying the memory penalty by N, where N is the number of children. This makes it almost certain that the parent will always be chosen as the victim of the OOM killer (assuming any substantial amount memory shared among the children), even if the parent and children are well behaved and have a reasonable and unchanging VM size. Usually this does not actually alleviate the memory pressure because the truly bad process is completely unrelated; and the OOM killer must later kill the truly bad process. This trivial patch corrects the calculation so that it does not count a child's shared memory against the parent. Regards, Jeff Davis