whay can't processes shrink as well as grow?

George Michaelson ggm at brolga.cc.uq.oz.au
Thu Oct 4 08:59:43 AEST 1990


My understanding is that existing brk/sbrk/malloc in generic *nix
doesn't allow the process to shrink again once mem has been allocated.

Could somebody explain to a non-wizard what stops some method being
used to detect free mem pages or compress the heap such that memory
CAN be freed? I dont mean "for free" ie explain what would have to
be different in HOW malloc/alloc/sbrk/free work to get this behaviour.

I'm expecting to be told that keeping back-pointers to entities using
allocated memory so you could dynamically update their position if
you'd compressed the heap is more pain than it's worth. If thats not
the case, I see some attractive uses of grabbing 5-10 Mb of space, using
it and then releasing it without having to exit.

	-George

-- 
	G.Michaelson
Internet: G.Michaelson at cc.uq.oz.au                     Phone: +61 7 377 4079
  Postal: George Michaelson, Prentice Computer Centre
          The University of Queensland, St Lucia, QLD Australia 4067. 



More information about the Comp.unix.internals mailing list