RFR: 8362123: ClassLoader Leak via Executors.newSingleThreadExecutor(...) [v2]

Alan Bateman alanb at openjdk.org
Thu Oct 9 16:13:18 UTC 2025


On Fri, 26 Sep 2025 16:42:49 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!
>
> Chris Dennis has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:
> 
>   8362123: ClassLoader Leak via Executors.newSingleThreadExecutor(...)
>   
>   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.

Yes, you need to use "/integrate", and then one of us will sponsor.

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

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


More information about the core-libs-dev mailing list