RFR: 8362123: ClassLoader Leak via Executors.newSingleThreadExecutor(...)

Chris Dennis duke at openjdk.org
Fri Sep 26 16:42:52 UTC 2025


On Mon, 14 Jul 2025 15:49:04 GMT, Chris Dennis <duke at openjdk.org> wrote:

> Executors shutdown via `shutdownNow()` should have their cleanables cleaned to prevent a classloader leak. This can happen if a classloader exists that both references the wrapped executor and is referenced by the delegate executor.
> 
> To quote @Martin-Buchholz:
>> BTW: I find Cleaners much harder to use than old finalize, and it looks like I'm not the only one!

Apologies for the force push, force of habit from my normal work.

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

PR Comment: https://git.openjdk.org/jdk/pull/26296#issuecomment-3339548199


More information about the core-libs-dev mailing list