classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: Use WeakHashMap in java.util.ResourceBundle


From: Tom Tromey
Subject: Re: [cp-patches] RFC: Use WeakHashMap in java.util.ResourceBundle
Date: 19 Sep 2005 15:42:53 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Robert" == Robert Schuster <address@hidden> writes:

Robert> 2005-09-19  Robert Schuster  <address@hidden>
Robert>     * java/util/ResourceBundle.java: Changed type of bundleCache
Robert>     to WeakHashMap.

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 (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.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]