Garbage collector memory leak "feature"?

David Brown dlang at davidb.org
Sat Oct 13 07:42:25 PDT 2007


On Sat, Oct 13, 2007 at 09:07:12PM +1300, nick.b wrote:

> "Hmm, the keys of my hash were all stored in an AA.  At least the AA only  
> has the first 4 bytes of the hash rather than the whole thing."
>
> So, thanks for posting the bug with the test case. I had thought there was 
> an outstanding issue, but this does not seem to be the case.

It still leaks, just more slowly now.  By making the key a reference (a
class) instead of a struct, I store much less data directly in the AA for
the GC to follow, it still follows the random pointers of the hash field.

Or at least this is my suspicion.  There is a lot of other stuff going on,
so it certainly isn't a good minimal example of reproducing the problem.

Perhaps taking the test case and using random numbers instead of
incrementing integers will show the problem.

Dave



More information about the Digitalmars-d mailing list