[fpc-pascal]FPC Heap Allocation/Deallocation

James Mills prologic at prologitech.com
Fri May 16 15:33:18 CEST 2003


On Fri, May 16, 2003 at 03:23:05PM +0200, Jonas Maebe wrote:
> 
> On vrijdag, mei 16, 2003, at 15:13 Europe/Brussels, James Mills wrote:
> 
> >Does the Heap manager on FPC release memory that's freed or keeps it
> >there ? My program loads up flat file databases (obviously bad but...)
> >which seems to chew up over 127Mb of ram, but it doesn't seem to be
> >released back to the system after reading...
> 
> Indeed, it's kept allocated for later reuse by the program.
> 
> >I heard somewhere that FPC 1.0.6 doesn't release memory once it's been
> >freed ? If so, will future versions release the memory back to the
> >system ?
> 
> No. The reason is that it's much more efficient for most programs to 
> keep the memory allocated (they'll most likely use it again later on) 
> and the default heap manager is written to be optimal for the common 
> case. If you want other behaviour, you should either directly request 
> the memory from the system and release it yourself for that particular 
> allocation, or write your own heap manager.

Thanks.

> 
> 
> Jonas
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list