1. Never allow overcommit when calling malloc
2. Allow overcommit on fork/exec, but kill the child process if it tries to
write to more than 10% of its virtual size.
This way, buggy programs that malloc too much memory and never use them
would be fixed and fork bombs would be killed, while still allowing to do do
system calls between fork and exec.
Posted Nov 14, 2009 20:52 UTC (Sat) by Gady (subscriber, #1141)
[Link]
Killing the child process if it uses more than 10% is kinda cruel. There are no rules against the child doing that. What should be done is that in this case the memory is allocated, and if that cannot be done, then the child is killed.
A suggestion
Posted Nov 15, 2009 20:03 UTC (Sun) by jlmassir (guest, #48904)
[Link]
Killing a child if there is no memory for a fork-exec is kinda cruel.