Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4291376

Introspector should use WeakHashMap for its cache

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • 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)
      ======================================================================

            mdavidsosunw Mark Davidson (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: