March 08, 2007
> I use dmd 1.007 on winxp sp2.  What are you using?
Exactly the same..

My virtual memory is 768MB (I have no idea if this is revelevant, but in my spurious thinking, it may effect how the GC gives memory back to the OS)

 - Paul
March 08, 2007
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.
March 08, 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.
March 08, 2007
Sean Kelly wrote:
> 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.

It's supposed to recover memory for future use, but it doesn't do that.  Is that a correct description of the current situation?  I'm not sure what you're really saying, you seem to imply that it does actually does recover memory.  With my test app it sure doesn't reuse it, at least not for the next allocation that is made.
March 08, 2007
torhu wrote:
> With my test app it sure doesn't reuse it, at least not for the next allocation that is made.

Yeah.  This is weird because I'd expect it to, but then I didn't write the GC.  When I get some time I'm going to debug the thing and see what's going on.
1 2
Next ›   Last »