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

Memory leak when component is extended and implemented as inner class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6
    • client-libs
    • generic
    • generic

      I have a class which extends canvas. If this class is implemented as inner class, the instances are never getting garbage collected. It occurs on all platforms. It works fine with Tiger. If the same class is taken out, the objects are gced.

      Compile and run attached AWTGCTest. If finalize method is not invoked atleast once, bug is reproduced.

      Now change line 19 in the sample code to:
      Canvas canvas = new DisplayCanvas();
      Compile and run again, finalize method will be called properly and objects are gced.

      This causes memory leak in lot many applications and the reliability tests are failing.
      ###@###.### 2004-11-09 05:57:26 GMT

            Unassigned Unassigned
            rmenonsunw Rakesh Menon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: