Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!well!jef From: jef@well.sf.ca.us (Jef Poskanzer) Newsgroups: comp.unix.internals Subject: Re: whay can't processes shrink as well as grow? Message-ID: <20955@well.sf.ca.us> Date: 5 Oct 90 00:00:00 GMT References: <1990Oct04.104221.16632@virtech.uucp> Reply-To: Jef Poskanzer Organization: Paratheo-Anametamystikhood Of Eris Esoteric, Ada Lovelace Cabal Lines: 20 In the referenced message, cpcahil@virtech.UUCP (Conor P. Cahill) wrote: }In article <1990Oct3.225943.4691@brolga.cc.uq.oz.au> ggm@brolga.cc.uq.oz.au (George Michaelson) writes: }>I see some attractive uses of grabbing 5-10 Mb of space, using }>it and then releasing it without having to exit. } }You could probably do with other mechanisms that do not require the jump }to 10MB of mem and the fall back to 0, or that use a child program to }process the 10MB of data and passes it's output back to the parent and }exits (thereby freeing the allocated memory). The child process idea is good. Another trick that I've used is to have the program restart itself with an "execvp(*argv, argv);" This is for situations when the process's interaction model is "wait for a long time, do something that needs a lot of memory, go back to waiting". For example, a screen saver. --- Jef Jef Poskanzer jef@well.sf.ca.us {ucbvax, apple, hplabs}!well!jef "Do you think we can use battery operated devices under water?"