commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clebert Suconic <csuco...@redhat.com>
Subject Re: Fwd: Circular Reference on WeakHashMap
Date Wed, 08 Aug 2007 05:08:34 GMT
The insomnia got me today...  Couldn't sleep! :-)
https://issues.apache.org/jira/browse/BEANUTILS-291

There is a proposed fix on the JIRA.. it works!

Nice.. isn't?


The idea is to use a WeakHashMap<ClassLoader, FastHashMap> on the 
Property also. I don't think this would cause performance issues, since 
WeakhashMap would have just few lines, and it would be released fairly 
quickly. Someone could create a ConcurrentWeakHashMap for that though... 
(I have created one for JBossSerialization already.. but there is not 
secret on that)

Whoever apply the fix, please run the testcase without the fix, and then 
with the fix.


The memory leak testcase needs to be expanded though... I don't know for 
instance if DynaBeans would cause a leak or not, since they are not 
being used on this test.

And this gets a nice idea about how you would fix any similar bugs.


Any chance this will be applied before 1.8 final?


Clebert


Clebert Suconic wrote:
>  > should the second sample on the wiki page not contain
>  > SoftReference reference = new SoftReference(x); instead of
>  > WeakReference reference = new WeakReference(x); ?
> 
> Yep! :-) Just fixed it.
> 
> Thanks!
> 
> Clebert
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message