-
Sub-task
-
Resolution: Delivered
-
P4
-
21
Some older, user-defined class loaders would workaround a deadlock issue by releasing the class loader lock during the loading process. To prevent these loaders from encountering a `java.lang.LinkageError: attempted duplicate class definition` while loading the same class by parallel threads, the HotSpot Virtual Machine introduced a workaround in JDK 6 that serialized the load attempts, causing the subsequent attempts to wait for the first to complete.
The need for class loaders to work this way was removed in JDK 7 when parallel-capable class loaders were introduced, but the workaround remained in the VM. The workaround was deprecated in JDK 20 and the option `-XX:+EnableWaitForParallelLoad` was introduced for users who relied on this legacy behavior. The default for this option was off.
In JDK 21, the option `-XX:+EnableWaitForParallelLoad`, and the code to support it, has been removed.
See CSRJDK-8304056 for more details.
The need for class loaders to work this way was removed in JDK 7 when parallel-capable class loaders were introduced, but the workaround remained in the VM. The workaround was deprecated in JDK 20 and the option `-XX:+EnableWaitForParallelLoad` was introduced for users who relied on this legacy behavior. The default for this option was off.
In JDK 21, the option `-XX:+EnableWaitForParallelLoad`, and the code to support it, has been removed.
See CSR
- relates to
-
JDK-8296446 Release Note: Deprecate and Disable Legacy Parallel Class Loading Workaround for Non-Parallel-Capable Class Loaders
- Resolved