[fpc-devel]Bad heap manager?

Florian Klaempfl Florian.Klaempfl at gmx.de
Thu Feb 28 12:20:41 CET 2002


At 08:26 28.02.02 +0100, you wrote:


>On Thu, 28 Feb 2002, Peter Vreman wrote:
>
> > > I could send my unfortunate program (the day after tomorrow) but it
> > > is relatively big.
> >
> > Can you send it to me
>
>I'm quite sure it uses a lot of reallocmem's and FPC's hepmanager is
>currently very bad at compacting the heap (so most of the time we have to
>allocate a new block when someone does a realloc mem and we end up with a
>lot of small, often even contiguous, blocks which are never concatenated).
>
>Concatenating when allocating instead of when freeing would help here, but
>it would probably slow down the heap manager in cases where this wouldn't
>be necessary otherwise.

The point is that you can't write a heap manager which is efficient for all
cases and applications!

The FPC heap manager is optimized for the compiler and performs
good in common cases. But under certain circumstances it allocates a lot of
memory from the OS to fullfil it needs.





More information about the fpc-devel mailing list