Will Ultrix free() ever learn to reset brk() to free memory?

Ian! D. Allen [CGL] idallen at watcgl.waterloo.edu
Tue Oct 30 17:10:26 AEST 1990


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 at watcgl.uwaterloo.ca idallen at watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada



More information about the Comp.unix.ultrix mailing list