GC, memory leaks and 32/64 bit

bearophile bearophileHUGS at lycos.com
Tue Mar 12 06:07:29 PDT 2013


Alexandr Druzhinin:

> 32 bit versions (using dmd and gdc, win7/ubuntu 12.04) of my 
> application always leak very fast. But 64 bit version (ubuntu 
> 12.04 only, win7 segfaults) works stable without any leaks. I'm 
> curious is there some workaround or I have to wait for GC 
> improvement to build 32bit version, without choice?

This difference is caused by the difference in pointer space size 
coupled with the nature of a conservative GC.
The "workarounds" are not easy, like allocating your largest 
arrays from the C heap.
The past Summer Of Code was worked on a much more precise GC (but 
not fully precise) meant to reduce this problem a lot on 32 bit 
systems, but nothing solid has so far come out of that. It 
probably needs to be polished, tested, etc.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list