In test 3, your keys are primitive types. That kind of test should either never put anything in the dictionary or never free anything from the dictionary. I could ask the player team for their opinion, but really, Dictionary has no really value being used with primitive type keys so I'm not interested in taking their time on this topic. Also, I haven't seen your test code so I don't know if you are actually giving the GC a change to run, or are out-pacing the GC. GC is synchronous and not a separate thread.
In test 2, your key and the object are the same, so the object has a hard reference from the Dictionary's value table and thus the key is never going to be freed. -Alex ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of iiley Sent: Tuesday, January 29, 2008 12:04 AM To: flexcoders@yahoogroups.com Cc: [EMAIL PROTECTED] Subject: Re: [flexcoders] Dictionary weakKeys feature or it's a GC bug I ran TestDic again for test3 method, it eat all my 2G ram after a while. The key has no more referrence, so the value should be GCed, well, however the GC is opportunistic, but why he did not find a chance to free some memory till all 2G are eaten? Such a GC, i'm afraid to trust it. Or, there's something i understand wrong? Thanks for join this boring and complex question, it really frustrated me so much. -- iiley AsWing http://www.aswing.org <http://www.aswing.org> Personal http://www.iiley.com <http://www.iiley.com>