RFR: 6543126: Level.known can leak memory

Daniel Fuchs daniel.fuchs at oracle.com
Mon Jul 25 18:10:20 UTC 2016


Please find below a fix for:

6543126: Level.known can leak memory


This is a fix for a long standing issue: Level maintains a list
of know levels which has strong references to any created levels.
Because the references are strong references, they prevent the garbage
collection of levels, level classes, and level class loaders.

This fix changes the KnownLevel class to extend WeakReference<Level>
in order to only retain a weak reference to custom level instances.

best regards,

-- daniel

More information about the core-libs-dev mailing list