Closed GoogleCodeExporter closed 8 years ago
I see your point but at the moment I cannot find a better alternative.
I cannot replace the WeakHashMap with a ConcurrentHashMap because I need the
weak map in order to avoid memory leaks: when an argument is out of the scope
of any method the use of the WeakHashMap makes it garbage collectable.
Also the suggested fix is not viable: invoking a get without synchronization is
not safe (you could be in the middle of a rehashing) and invoking the get twice
could harm the performance even worse.
Original comment by mario.fu...@gmail.com
on 29 Jan 2012 at 11:37
Can't you use something like
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect
/MapMaker.html#weakKeys() ?
Original comment by m.jedy...@gmail.com
on 1 Dec 2014 at 8:37
Original issue reported on code.google.com by
le...@web.de
on 25 Jan 2012 at 4:30