C
Chris
I'm trying to build a memory-sensitive cache using WeakHashMap. The
trouble that I'm having is that the system dumps the references (that
is, gc()'s them) long before it needs to. I'm getting way too many cache
misses. When I replace WeakHashMap with a regular HashMap, things work
great. Of course, HashMap won't work in production because we'll run out
of memory. How do I get WeakHashMap to stand its ground and not dump
references before it really needs to?
Or alternatively, is there a decent cache class out there already so I
don't have to write one?
trouble that I'm having is that the system dumps the references (that
is, gc()'s them) long before it needs to. I'm getting way too many cache
misses. When I replace WeakHashMap with a regular HashMap, things work
great. Of course, HashMap won't work in production because we'll run out
of memory. How do I get WeakHashMap to stand its ground and not dump
references before it really needs to?
Or alternatively, is there a decent cache class out there already so I
don't have to write one?