Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!lll-tis!helios.ee.lbl.gov!nosc!humu!uhccux!lupton From: lupton@uhccux.uhcc.hawaii.edu (Robert Lupton) Newsgroups: comp.lang.c Subject: Storage Allocation/compaction Keywords: malloc Message-ID: <2045@uhccux.uhcc.hawaii.edu> Date: 13 Jul 88 20:55:36 GMT Reply-To: lupton@uhccux.UUCP (Robert Lupton) Organization: University of Hawaii Lines: 15 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