LWN.net Logo

A suggestion

A suggestion

Posted Nov 12, 2009 5:17 UTC (Thu) by jlmassir (guest, #48904)
In reply to: posix_spawn is stupid as a system call by helge.bahmann
Parent article: Toward a smarter OOM killer

Maybe then the solution to this problem would be:

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.

What do you think?


(Log in to post comments)

A suggestion

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.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds