A program leaking memory.

Hasan Aljudy hasan.aljudy at gmail.com
Mon Mar 13 16:55:09 PST 2006


Johan Grönqvist wrote:
> Thomas: Thak you very much for your answer!
> 
> Now I have found the cause to this problem,
> 
> The garbage collector collects so rarely that my system starts swapping
> intensely.
> 
> This time I only used gdc.
> (gcc version 4.0.1, gdc 0.17, using dmd 0.140)
> 
> Any hints to the solution are most welcome!
> 
> Is there a way to tell the gc never to use more than (say) 100MB of memory?
> I could insert an if-clause in each step, calling the collector if some
> limit is exceeded, but if feels a bit inelegant.
> 
> 
> Comments to Thomas Kuehnes very helpful answer below.
> 
> / johan
> 

maybe you can call gc.fullCollect() every once in a while

http://www.digitalmars.com/d/phobos/std_gc.html



More information about the Digitalmars-d-learn mailing list