Although clone(CLONE_VFORK...) didn't work out, <br>using glibc's vfork instead did.  The glibc code to handle vfork<br>is quite different from the code for clone(CLONE_VM | CLONE_VFORK),<br>especially for saving/restoring pids.<br>
<br>This time, I tested on 32-bit and 64-bit Linux.<br><br>Michael, please review.<br><br><a href="http://cr.openjdk.java.net/~martin/vfork-exec/">http://cr.openjdk.java.net/~martin/vfork-exec/</a><br><br>As always, we'll need a bug filed.<br>
Synopsis: (process) Use vfork, not fork, on Linux to avoid swap exhaustion<br><br>And again, my changes are conflicting with Michael's changes for Solaris.<br>I will negotiate with Michael for who gets to commit first.<br>
We will likely end up with 4 different strategies for "forking":<br>fork, clone, vfork, and helper process.<br><br>Note to integrators: the process changes continue to be high-risk.<br>Extra JPRT runs might be a good idea.<br>
<br>Martin<br><br><br><div class="gmail_quote">On Tue, Jun 23, 2009 at 07:51, Christos Zoulas <span dir="ltr"><<a href="mailto:christos@zoulas.com">christos@zoulas.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Jun 23,  3:33pm, <a href="mailto:aph@redhat.com">aph@redhat.com</a> (Andrew Haley) wrote:<br>
-- Subject: Re: Review request for 5049299<br>
<br>
</div><div class="im">| I can debug this.<br>
|<br>
| Please try first syscall(SYS_clone ...) to bypass the libc gubbins.<br>
| That might be all you need.  If that doesn't help I'll have a look.<br>
|<br>
| Isn't there some point at which you have to say to a Linux user "Your<br>
| system is simply misconfigured.  Fix the overcommit parameter and this<br>
| problem will go away"  ?<br>
<br>
</div>Another thing to try is to add CLONE_VFORK to suspend the parent.<br>
<font color="#888888"><br>
christos<br>
</font></blockquote></div><br>