JDK-8058296 : LogManager Cleaner prevents garbage collection of current context class loader.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-09-12
  • Updated: 2019-03-12
  • Resolved: 2019-03-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdFixed
Related Reports
Duplicate :  
Description
From: Stanimir Simeonoff: 

<<
On leaks. The c-tor of LogManager leaks the thread group and the current AccessControlContext till JVM shutdown. The constructor code should be something like the one below with Cleaner getting ThreadGroup in its c-tor as well.


    java.security.AccessController.doPrivileged(//zip thread.inheritedAccessControlContext
        new java.security.PrivilegedAction<Void>() {
        public Void run() {
            // put the cleaner in the systsm threadgroup
            ThreadGroup grp = Thread.currentThread().getThreadGroup();           
            for(ThreadGroup parent;null!=(parent = grp.getParent());) {
                grp = parent;
            }

            Cleaner cleaner = new Thread(grp);
            cleaner.setContextClassLoader(null);//zip the classloader
           
            // Add a shutdown hook to close the global handlers.
            try {
                Runtime.getRuntime().addShutdownHook(cleaner);
            } catch (IllegalStateException e) {
                // If the VM is already shutting down,
                // We do not need to register shutdownHook.
            }

            return null;
        }
    });
>>

see http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-September/028667.html

Comments
I believe this issue was fixed as a side effect of JDK-8153158.
12-03-2019

See also: JDK-8029834, JDK-8025251.
12-09-2014