On 12/21/06, Ignacio Marambio Catán <[EMAIL PROTECTED]> wrote:
On 12/21/06, Peter Buckingham <[EMAIL PROTECTED]> wrote:
> huy vu wrote:
> > Thank to you both, Nacho and Joerg. However I would love to hear why
> > the call to exec would fail right after a call to fork(). From
> > reading things about vfork() it sounds like its sole purpose is to
> > allow people to call exec right after a fork. I just like to
> > understand why exec doesn't work well with fork(). Is it because the
> > scheduler is not ready or unpredictable after a fork()?
>
> Think of a situation where the memory footprint of the parent is large
> and you want execute something with a small footprint, eg execing
> something from a java process.
>
> The fact that you are execing means you don't need to access the address
> space of the parent for communication so why copy it? (like is done in fork)
>
> Linux uses Copy on Write to address this problem.
>
iirc, so does solaris but solaris does check whether there is enough
memory to actually hold a full copy of the parent address space

Linux overcommits / lazy loads on memory allocations, though this is
tunable.  I believe the default setting is to overcommit, which can
lead to the random killing of processes in order to retrieve memory
should one run out.  I forget the terminology used for that particular
system.

--
Eric Enright
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to