whay can't processes shrink as well as grow?
Jef Poskanzer
jef at well.sf.ca.us
Fri Oct 5 10:00:00 AEST 1990
In the referenced message, cpcahil at virtech.UUCP (Conor P. Cahill) wrote:
}In article <1990Oct3.225943.4691 at brolga.cc.uq.oz.au> ggm at 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 at well.sf.ca.us {ucbvax, apple, hplabs}!well!jef
"Do you think we can use battery operated devices under water?"
More information about the Comp.unix.internals
mailing list