[comp.sys.amiga] Re2: Memory Fragmentation Question

dillon@CORY.BERKELEY.EDU (Matt Dillon) (08/24/87)

> >Am I correct in thinking that the Amiga's memory management causes
> >memory to be gradually fragmented into a bunch of little chunks?  If
> >this is so, has anyone written a program to coalesce these small chunks
> >into bigger chunks?

	No, the Amiga's memory management *does* coalesce small chunks into
bigger ones.  An exaggerated example of the problem would be running a 
resident program while doing a compile.  When the compile finishes, it 
releases its memory, leaving a lot of blank space, then the resident program,
then more blank space.

	Unfortunetly, various system functions also allocate memory and this
is what *really* causes the fragmentation.  I think we need some new flags,
MEMF_SEMIPERMANENT for instance, which would allocate from the top of memory
instead of the bottom.

	This is one of the reasons the Amiga seems like a memory hog. 
Actually, once you get above a meg the problem disappears except for a few
special cases (e.g. I have 2 meg and recompiled compress to use the 16 bit
algorithm... it takes a whopping 500K contiguous storage!).  The problem is
partially offset by the scatter loading.

					-Matt