Storage Allocation/compaction

Robert Lupton lupton at uhccux.uhcc.hawaii.edu
Thu Jul 14 06:55:36 AEST 1988


I have been using malloc/free under 4.2/4.3 BSD in an image processing
programme that deals with 1Mby files, and otherwise makes heavy use of
dynamic memory. I find that after a while my process grows to vast sizes
(64 Mby or so), as the memory gets fragmented. Then malloc returns NULL,
or the system hangs up. Obviously, using limit to increase the datasize
would only postpone the problem.

Does anyone have a public domain storage allocator that could replace
malloc/realloc/free that also has a call to compactify the memory? I
don't wan't to write one, and I don't have a source licence to add a
call to the system version. From what I remember of the 4.2 malloc, using
realloc on freed space wouldn't help, as it doesn't compact the different
free lists.

		Robert Lupton



More information about the Comp.lang.c mailing list