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

Public API alternative for sun.misc.Cleaner

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      NetBeans APIs offer an "active" reference queue[1] which is automatically cleaned by one dedicated NetBeans thread. Once we got a bug report[2] that it behaves poorly when used inside of a WAR file. Whenever the WAR was redeployed, the number of cleanup threads increased by one, which also caused major memory leaks. We fixed that with a bit of reflection (nasty, of course). The fix worked OK, up until JDK-6853696 got fixed - the JDK-6853696 fix broke our assumptions, so now NetBeans is significantly broken on JDK9. I can either come up with another reflective trick[3] or be constructive and improve JDK to offer the functionality we need. This issue is my attempt to propose such JDK change.


      [1] http://bits.netbeans.org/8.0/javadoc/org-openide-util/org/openide/util/Utilities.html#activeReferenceQueue()

      [2] https://netbeans.org/bugzilla/show_bug.cgi?id=206621

      [3] https://netbeans.org/bugzilla/show_bug.cgi?id=245732

        Attachments

        1. ActiveQueueFinalizer.diff
          11 kB
          Jaroslav Tulach
        2. X.diff
          10 kB
          Jaroslav Tulach

          Issue Links

            Activity

              People

              • Assignee:
                rriggs Roger Riggs
                Reporter:
                jtulach Jaroslav Tulach
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: