Garbage collector noob

Sean Kelly sean at f4.ca
Thu Mar 8 08:06:51 PST 2007


torhu wrote:
> Derek Parnell wrote:
>> On Wed, 07 Mar 2007 06:15:16 +0100, torhu wrote:
>>> Now I want to work more closely with the GC.  Can anyone explain to 
>>> me why fullCollect doesn't seem to do anything here? 
>>
>> There is quite a large portion of the fullCollect source which is 
>> commented
>> out in phobos, mainly in the section which reclaims RAM (I think).
> 
> Do you mean gcx.d, line 1619?  That would explain some things. There's 
> also something  else of interest in that file:
> 
> void minimize()    // minimize physical memory usage
> {
>     // Not implemented, ignore
> }
> 
> Is this really the one being called as std.gc.minimize?  Looks like it. 
>  I wish I had known this before.  I guess I should file a bug report; 
> either implement it or make the docs state that it is currently not 
> implemented.
> 
> If I knew what fullCollect() really was supposed to do, I could include 
> that in the bug report too.  I'm hoping someone with a better 
> understanding of this than me can help out here.

fullCollect performs a full collection of orphaned memory.  With the 
current GC, this memory is recovered for future use by the GC, but it 
not returned to the OS.


More information about the Digitalmars-d-learn mailing list