By: ⚛ (0xe2.0x9a.0x9b.delete@this.gmail.com), July 4, 2022 4:18 am
Room: Moderated Discussions
Adrian (a.delete@this.acm.org) on July 3, 2022 10:04 pm wrote:
> Foo_ (foo.delete@this.nomail.com) on July 3, 2022 2:45 am wrote:
> > Adrian (a.delete@this.acm.org) on July 1, 2022 9:58 pm wrote:
> > > Foo_ (foo.delete@this.nomail.com) on July 1, 2022 3:21 am wrote:
> > > > Adrian (a.delete@this.acm.org) on June 30, 2022 9:43 am wrote:
> > > > >
> > > > > When all the allocation and free requests are done from stacks, each stack corresponding
> > > > > to a certain size class, nothing ever changes from the point of view of fragmentation.
> > > >
> > > > This is delusional. Allocation may be done "from stacks", but given that deallocations
> > > > happen in random order (random from the POV of the allocator, of course), they
> > > > cannot be done in a simple stack-like (i.e. LIFO) fashion.
> > >
> > >
> > > When the size is variable, you are right.
> > >
> > > But when the size of a memory block is fixed (being used to satisfy any allocation
> > > requests between 2 thresholds), the allocations and deallocations are really
> > > done as LIFO from the stack containing the free memory blocks.
> >
> > You don't read what you reply to, do you?
> >
>
>
> Actually I have read carefully, but maybe I have not explained clearly enough.
>
> Even when the "free" invocations happen in a random order compared with the corresponding "malloc"
> invocations, ... [cut]
Adrian, please take your time to make sure you understand the following: The baseline of comparison for heap fragmentation is a fully defragmented heap. A fully defragmented heap is a heap on which full compaction has been performed. Thus, 0% fragmentation means that additional heap compaction is impossible.
-atom
> Foo_ (foo.delete@this.nomail.com) on July 3, 2022 2:45 am wrote:
> > Adrian (a.delete@this.acm.org) on July 1, 2022 9:58 pm wrote:
> > > Foo_ (foo.delete@this.nomail.com) on July 1, 2022 3:21 am wrote:
> > > > Adrian (a.delete@this.acm.org) on June 30, 2022 9:43 am wrote:
> > > > >
> > > > > When all the allocation and free requests are done from stacks, each stack corresponding
> > > > > to a certain size class, nothing ever changes from the point of view of fragmentation.
> > > >
> > > > This is delusional. Allocation may be done "from stacks", but given that deallocations
> > > > happen in random order (random from the POV of the allocator, of course), they
> > > > cannot be done in a simple stack-like (i.e. LIFO) fashion.
> > >
> > >
> > > When the size is variable, you are right.
> > >
> > > But when the size of a memory block is fixed (being used to satisfy any allocation
> > > requests between 2 thresholds), the allocations and deallocations are really
> > > done as LIFO from the stack containing the free memory blocks.
> >
> > You don't read what you reply to, do you?
> >
>
>
> Actually I have read carefully, but maybe I have not explained clearly enough.
>
> Even when the "free" invocations happen in a random order compared with the corresponding "malloc"
> invocations, ... [cut]
Adrian, please take your time to make sure you understand the following: The baseline of comparison for heap fragmentation is a fully defragmented heap. A fully defragmented heap is a heap on which full compaction has been performed. Thus, 0% fragmentation means that additional heap compaction is impossible.
-atom