Taming the OOM killer
Posted Feb 5, 2009 10:17 UTC (Thu) by epa
In reply to: Taming the OOM killer
Parent article: Taming the OOM killer
any process that forks and execs allocates more memory than it needs.
Quite. Which is why a single fork-and-exec-child-process system call is needed. With that, there would be much less need to overcommit memory and so a better chance of avoiding hacks like the OOM killer.
The classical Unix design of separate fork() and exec() is elegant at first glance, but in practice it has caused various unpleasant kludges to cope with the memory overcommit. (Another one was vfork(), which IIRC was a fork call that used less memory but only worked as long as you promise to call exec() immediately afterwards. Why they didn't make a single fork-plus-exec primitive rather than this crufty interface eludes me.)
to post comments)