[fpc-devel] FPC memory manager and OS/2 - heap sub-allocation

Tomas Hajny hajny at freepascal.org
Tue Jun 30 23:13:54 CEST 2026


30. června 2026 17:54:55 SELČ, Karoly Balogh via fpc-devel <fpc-devel at lists.freepascal.org> napsal:


Hi Charlie,

> On Tue, 30 Jun 2026, Tomas Hajny via fpc-devel wrote:
> 
> > In addition, thinking about it a bit more, I just noticed another
> > potential reason of the misalignment between the overall memory still
> > available and the memory allocation failing... Originally, OS/2 didn't
> > allow allocation of more than 512 MB of RAM per process (that limit has
> > its reasons, but those go beyond this post).
> 
> Yeah, this was also my first reaction, when you were talking about getting
> an an OOM, that you might run into the per process limit of 512MB address
> range (which is in practice even less "available memory" because every
> process has shared memory range too, and what else, which to my
> understanding also counts into the 512MB limit.

Indeed, it's the same address space


> But regardless of what the actual limit is - to take hundreds of MB to
> compile a Free Vision app or the IDE sounds a bit excessive. Don't we have
> a memory leak somewhere? I used to be able to compile this stuff on an
> Amiga with 128MB RAM... I understand that the compiler gained quite some
> features since, so internal structures might have grown, but have they
> really grown this much?

I can't comment the potential leaks, but I'm afraid they have - in a comment attached to a recent commit, Rika mentioned just the compiler compilation requiring almost 500 MB. That's clearly not really the case yet (at least not on a 32-bit machine) because compiler cycling still succeeds under OS/2, but adding the IDE with all its units and dependencies to the requirements of the embedded compiler might possibly get beyond that point...

Tomas



More information about the fpc-devel mailing list