-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 21, 22, 23, 24, 25
-
Component/s: core-libs
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8370007 | 25.0.2 | Severin Gehwolf | P4 | Resolved | Fixed | b03 |
| JDK-8370488 | 21.0.10 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
"I believe I've identified a bug in Executors.AutoShutdownDelegatedExecutorService that can trigger a classloader leak even in the presence of "correct" Executor lifecycling. AutoShutdownDelegatedExecutorService only unlinks the PhantomReference used for cleanup handling when it is shutdown via the shutdown() method. If an Executor wrapped in this way is instead shutdown using the shutdownNow() method and it references a classloader via an injected attribute: ThreadFactory, AbortPolicy, etc. then the cleanup action will reference the classloader, and the classloader will remain strongly referenced. Adding an additional override as shown in the attached patch is sufficient to fix the leak in my testing."
- backported by
-
JDK-8370007 ClassLoader Leak via Executors.newSingleThreadExecutor(...)
-
- Resolved
-
-
JDK-8370488 ClassLoader Leak via Executors.newSingleThreadExecutor(...)
-
- Resolved
-
- caused by
-
JDK-8302899 Executors.newSingleThreadExecutor can use Cleaner to shutdown executor
-
- Resolved
-
- duplicates
-
JDK-8367726 AutoShutdownDelegatedExecutorService does not delegate shutdownNow
-
- Closed
-
-
JDK-8367726 AutoShutdownDelegatedExecutorService does not delegate shutdownNow
-
- Closed
-
- links to
-
Commit(master)
openjdk/jdk21u-dev/2a7c7bfd
-
Commit(master)
openjdk/jdk25u/9018319c
-
Commit(master)
openjdk/jdk/d5a20799
-
Review(master)
openjdk/jdk21u-dev/2346
-
Review(master)
openjdk/jdk25u/295
-
Review(master)
openjdk/jdk/26296