RFR: 8303740 JavaFX - Leak in Logging, Logging remembers last exception

Florian Kirmaier fkirmaier at openjdk.org
Tue Mar 7 13:35:25 UTC 2023


On Tue, 7 Mar 2023 11:59:20 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:

> When an exception is logged in JavaFX, then the exception is kept in a reference.
> This way, always the last logged exception is retained.
> 
> This is a memory-leak.
> This was done to write unit-tests to ensure certain error-cases are logged.
> 
> A simple fix is, to add a flag, to enable/disable retaining the exception.

Storing the class is, in my opinion also wrong.
Especially OSGI and other multi-classloader environments suffer from this issue. 

IMO it's okay to test things this way - but I guess that doesn't matter because I only want to fix this big.

-------------

PR: https://git.openjdk.org/jfx/pull/1053


More information about the openjfx-dev mailing list