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

Native objects should use WeakRefs to point to their associated Java object

XMLWordPrintable

    • sparc
    • solaris_2.5.1

      If the native structure associated with a Java object contains a GlobalRef
      to that Java object then that reference will prevent collection of the
      object when all external references go away. If the object was relying
      on finalization to destroy the native data and delete the reference then
      that object will never be collected.

      This problem was preventing WGraphics objects from being collected and that
      bug was fixed for 4095168, but the m_peerObject reference in the AwtObject
      superclass of all of the peers typically also contains a GlobalRef that
      could potentially prevent collection of the peer. Since peers tend to be
      fairly meticulously garbage collected this doesn't happen very often, but
      the fix should be applied to make the AWT more robust (see Suggested Fix).

            Unassigned Unassigned
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: