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

Chris Dennis duke at openjdk.org
Fri Oct 10 09:23:24 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!

This pull request has now been integrated.

Changeset: d5a20799
Author:    Chris Dennis <chris.w.dennis at ibm.com>
Committer: Alan Bateman <alanb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d5a207994b9c374e6638e57826326f8f4593b96b
Stats:     65 lines in 2 files changed: 63 ins; 1 del; 1 mod

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

Reviewed-by: vklang, alanb

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

PR: https://git.openjdk.org/jdk/pull/26296


More information about the core-libs-dev mailing list