Garbage collector noob

torhu fake at address.dude
Wed Mar 7 05:04:19 PST 2007


Lutger wrote:
> torhu wrote:
>> Removing the call to fullCollect() doesn't change the behavior.  I 
>> expected fullCollect to collect as much memory as it can, and then reuse 
>> it for the next allocation.  Am I on the wrong track here?
> 
> Not being exactly an expert on garbage collection myself, I did 
> encounter the same behaviour which could be changed with a call to 
> std.gc.minimize. This led me to think fullCollect does in fact not 
> always clean up all unused memory, but just forces a GC scan, which may 
> decide there is no need to collect if enough memory is available. Can 
> anybody confirm this?

I tried minimize, but now the memory usage goes even higher, up to 469 
MB instead of 426.  So none of these functions seem to do what the docs 
say.  Same goes for tango.core.Memory.gc.collect().


More information about the Digitalmars-d-learn mailing list