[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] RFC: Use WeakHashMap in java.util.ResourceBundle
From: |
Robert Schuster |
Subject: |
Re: [cp-patches] RFC: Use WeakHashMap in java.util.ResourceBundle |
Date: |
Tue, 20 Sep 2005 00:20:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.11) Gecko/20050916 |
Hi,
> Unfortunately I don't think this is the correct solution. In practice
> I think this patch would not cause caching for very long -- the next
> GC cycle would notice that there are no other references to the keys
> in the map, and it would be cleared.
> One idea would be a map where the entries are soft references, so that
> (in theory) they are only cleared when memory is needed
OK, I thought WeakHashMap would work this way.
> (though at
> least libgcj treats soft references like weak ones atm). Or, we could
> have a fixed size cache that removes the least-recently-used entry.
We have so many VM with so many different runtime parameters. I am in favor of
implementing a SoftHashMap to let the GC decide when to clean out unused
references.
cu
Robert