-
Enhancement
-
Resolution: Fixed
-
P4
-
1.2.2
-
beta
-
generic
-
generic
Name: mc57594 Date: 11/15/99
java version "1.2.2"
HotSpot VM (1.0.1, mixed mode, build g)
The java.beans.Introspector class includes two static hashtables for caching
purposes. The first (beanInfoCache) maps class objects onto their BeanInfo
objects and the other (declaredMethodCache) maps class objects onto an array of
their public methods. As long as these caches exist (which is essentially for
the lifetime of the VM) any classes stored in them cannot be garbage collected.
I suggest that these caches be changed to instances of java.util.WeakHashMap
which will automatically remove the cached information when the class is no
longer referenced by the program.
NOTE: The declared method cache may cause some problems since each Method object
in the array contains a reference to its declaring class.
(Review ID: 97183)
======================================================================