:: Re: [DNG] Memory management strateg…
Forside
Slet denne besked
Besvar denne besked
Skribent: Didier Kryn
Dato:  
Til: dng
Emne: Re: [DNG] Memory management strategies.
Le 01/02/2016 17:16, Rainer Weikusat a écrit :
> Rainer Weikusat <rainerweikusat@???> writes:
>
> [...]
>
>> A more problematic (for some definition of problematic) situation is
>> when there are many objects of different sizes and if objects whose
>> size is identical have vastly differing lifetimes. This introduces
>> so-called 'external fragmentation' into the malloc heap
> Additional information: The usual 'household number' associated with
> that would be that an allocator is considered memory efficient if not
> more than 50% of the memory managed by it is effectively lost due to
> external fragementation.


     Note that if you manage your memory pool as an array then 
allocation and deallocation are extremely fast and can be done without 
consuming a single byte for book-keeping. I think this almost trivial 
allocator actually fits with many cases. It can even make sense to loose 
part of the memory if objects haven't all the same size, provided this 
size is bounded.


     Didier