JDK-8175264 : Release Note: Loggers with handlers configured from the logging.properties configuration file will not be garbage collected until LogManager.reset is called.
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2017-02-20
  • Updated: 2017-09-22
  • Resolved: 2017-02-20
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.
JDK 9
9Resolved
Description
When a logger has a handler configured in the logging configuration file (using the `<logger>.handlers` property), a reference to that logger will be internally kept by the LogManager until `LogManager.reset()` is called, in order to ensure that the associated handlers are properly closed on reset. As a consequence, such loggers won't be garbage collected until `LogManager.reset()` is called. An application that needs to allow garbage collection of these loggers before reset is called can revert to the old behaviour by additionally specifying `<logger>.handlers.ensureCloseOnReset=false` in the logging configuration file. Note however that doing so will reintroduce the resource leak that JDK-8060132 is fixing. Such an application must therefore take the responsibility of keeping the logger alive as long as it is needed, and close any handler attached to it before the logger gets garbage collected. See LogManager API documentation for more details.