From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c70f02b79bc3d231 X-Google-Attributes: gid103376,public From: Mats.Weber@elca-matrix.ch Subject: Re: dynamic memory allocation Date: 1997/06/18 Message-ID: <33A7B0B4.F75C277D@elca-matrix.ch>#1/1 X-Deja-AN: 249287056 References: <33A55F1B.63FE@gsfc.nasa.gov> X-Priority: 3 (Normal) Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-06-18T00:00:00+00:00 List-Id: Jon S Anthony wrote: > Whether it's bad or not will really depend on the specifics of the > application and the memory manager. If the MM coaleces or compacts, I > don't see how _fragmentation_ will be a problem. [...] Should be "coaleces _and_ compacts". If it coaleces xor compacts, it is easy to construct a program that runs out of memory due to fragmentation. Moreover, compaction is quite unlikely to happen on most implementations as it requires a double indirection or a GC-like scanning of all live pointers. What we do to minimize fragmentation is to allocate only blocks with sizes that are powers of two, and maintain one free list per power of two. It does waste some storage but the program runs well for long periods of time.