commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject [beanutils] WeakHashMap or ReferenceMAP...?
Date Wed, 14 May 2003 18:17:13 GMT
this is about the replacement of BeanUtils singletons with instances per 
thread context classloader (this will ensure that different web apps 
access different instances). we need to make sure that when the 
classloader (used as the key) is garbage collected, the instance (which is 
the value) is made available for garbage collection.

i've test WeakHashMap on two 1.3 JVMs (macOSX and blackdown linux) and in 
both cases, the entry value is not correctly removed resulting in a memory 
leak. WeakHashMap works the way that we need on the 1.4 linux JVM i use 
(the sun one, i think).

the latest ReferenceMap from commons-collections works the way that we 
need it on all JVMs but this means switching the dependency to the latest 
(unreleased) commons-collections.

so it's  choice between using WeakHashMap in the knowledge that it will 
cause a memory leak on some(?) 1.3 JVMs or using ReferenceMap and 
depending on commons-collections CVS HEAD. comments anyone?

- robert


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


Mime
View raw message