Re: [cp-patches] RFC: ClassLoader associative cache

2006-08-21 Thread Archie Cobbs
Jeroen Frijters wrote: There are several places in our codebase were we need/want to cache stuff that is associated with a class or class loader. Currently these places retain a strong reference to the class loader, which is not correct, because the class loader should be garbage collectable.

RE: [cp-patches] RFC: ClassLoader associative cache

2006-08-21 Thread Jeroen Frijters
Jeroen Frijters wrote: Archie Cobbs wrote: Dumb question.. why wouldn't it work to just use a WeakHashMap instead of a HashMap in all those places? Not a dumb question at all. That *would* work. The problem is that (at least on some runtimes) WeakHashMap is much more expensive than