[comp.sys.mac.programmer] Really bad mem fragmentation

ews00461@uxa.cso.uiuc.edu (10/06/89)

I'm having difficulty with the Memory Manager in LSC:

Using the debugger, in the middle of my program's run, the scenario
looks like this:

	the program has allocated 320 non-relocateable blocks of memory,
	all of which are very small.  The total memory allocated is
	4369 bytes.  Some pointer have been freed and so forth, the
	memory allocation needs are very dynamic.  The application
	partition is 500 k, MaxApplZone has been called.  The largest
	free block, as reported by MaxMem() is 435806 bytes (seems big
	enough to me).  Total free memory is 435814 bytes, so it seems
	that my small blocks have kept memory relatively unfragmented.
	At this point, I request a block of 8 bytes.  The request is
	granted, but at a tremendous cost.  The Memory Manager now
	reports that free memory is 435894 (I gained 80 bytes !?).  The
	largest free block is... 72 bytes!  In summary, a simple 8 bytes
	memory block request fragmented away 435 k of memory into very
	tiny pieces.  Does anyone know why ??

Eric W Sink
ews00461@uxa.cso.uiuc.edu