By: Foo_ (foo.delete@this.nomail.com), June 30, 2022 9:07 am
Room: Moderated Discussions
Adrian (a.delete@this.acm.org) on June 30, 2022 8:31 am wrote:
>
> When there is a dedicated memory pool size for each possible requested size of an allocation (typically
> the requested sizes are rounded up to a power of two, to avoid an excessive number of memory pools),
> then the list of free memory blocks can be implemented as a stack, not as a heap, because all the
> blocks are equivalent and any of them can be returned to an allocation request.
>
> In this case, it no longer matters which is the sequence in time of allocate and free requests and
> which were the corresponding sizes, the state of the memory allocator from the point of view of the
> memory fragmentation is the same after one year of continuous running as at the start time.
You are assuming there is a steady state with an almost fixed (de)allocation rate. That is not the case for many workloads, where you can have spikes with many allocations and/or deallocations.
So you certainly can have a long term situation ("after one year of continuous running") where the heap occupancy is very spread out.
>
> When there is a dedicated memory pool size for each possible requested size of an allocation (typically
> the requested sizes are rounded up to a power of two, to avoid an excessive number of memory pools),
> then the list of free memory blocks can be implemented as a stack, not as a heap, because all the
> blocks are equivalent and any of them can be returned to an allocation request.
>
> In this case, it no longer matters which is the sequence in time of allocate and free requests and
> which were the corresponding sizes, the state of the memory allocator from the point of view of the
> memory fragmentation is the same after one year of continuous running as at the start time.
You are assuming there is a steady state with an almost fixed (de)allocation rate. That is not the case for many workloads, where you can have spikes with many allocations and/or deallocations.
So you certainly can have a long term situation ("after one year of continuous running") where the heap occupancy is very spread out.