Newsgroups: comp.unix.ultrix
Path: utzoo!utgpu!watserv1!watcgl!idallen
From: "Ian! D. Allen [CGL]" <idallen@watcgl.waterloo.edu>
Subject: Will Ultrix free() ever learn to reset brk() to free memory?
Message-ID: <1990Oct30.061026.26014@watcgl.waterloo.edu>
Sender: idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL])
Organization: Computer Graphics Laboratory, University of Waterloo, Ontario, Canada
Date: Tue, 30 Oct 90 06:10:26 GMT
Lines: 24

main()
{
	char *p;
	extern char *malloc();

	system("/bin/sh");
	p = malloc(8*1024*1024);
	system("/bin/sh");
	free(p);
	system("/bin/sh");
}

Run "ps laxwwt" and ^D (EOF) at each sh prompt and see that Ultrix
never takes back the 8Mb freed by the process.

Nice Unix systems reset the process brk() memory limit back down
after freeing the 8Mb.  Ultrix 3.1C does not.  You're stuck with the
high-water mark (and 8Mb of wasted swap) for the life of the process.

Is this the same in Ultrix 4.[01]?  Anyone have a nicer malloc/free
that knows how to do this?  I'd like to feed it to my X server...
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada
