*BSD News Article 5617


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!news.byu.edu!ux1!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: Marvellous Memory Munching Make
Message-ID: <1992Sep25.174613.19954@fcom.cc.utah.edu>
Keywords: where does it go? what does it do?
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <1992Sep25.020038.28923@citec.oz.au>
Date: Fri, 25 Sep 92 17:46:13 GMT
Lines: 24

In article <1992Sep25.020038.28923@citec.oz.au> sgccseh@citec.oz.au (Steve Hocking) writes:
>
>	I've noticed that make seems to eat memory like there's no tomorrow.
>Often I have to stop & restart a make because gcc et al complains about
>being out of memory. I know that if I reinstall with something other than
>the default swap size, then the problem will be hidden, but it seems like
>this is not the optimal solution. BTW the leak only seems to happen when
>make actually kicks off another program.

This is because of the malloc before the exec.  Change the "vfork" used to
start the child process to a "fork" and the memory leak will go away.  This
will make make somewhat slower, but since the malloc occures into the parents
heap, this is the culprit.  The problem gets worse on larger environments
set up by the user.

(I wish I could take credit for the fix, but I can't.  It came out of some
mail I got as a result of complaining about it myself).


-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------