-
Sub-task
-
Resolution: Delivered
-
P4
-
20
Some user-defined, older 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. That workaround is finally being removed and as a first step has been deprecated and disabled by default. If you start seeing "java.lang.LinkageError: attempted duplicate class definition", then you may have an affected legacy class loader. The flag `-XX:+EnableWaitForParallelLoad` can be used to temporarily restore the old behavior in this release of the JDK, but the legacy class loader will need to be updated for future releases.
See the CSR request (JDK-8295848) for more background and 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. That workaround is finally being removed and as a first step has been deprecated and disabled by default. If you start seeing "java.lang.LinkageError: attempted duplicate class definition", then you may have an affected legacy class loader. The flag `-XX:+EnableWaitForParallelLoad` can be used to temporarily restore the old behavior in this release of the JDK, but the legacy class loader will need to be updated for future releases.
See the CSR request (
- relates to
-
JDK-8303967 Release Note: Obsolete Legacy HotSpot Parallel Class Loading Workaround Option `-XX:+EnableWaitForParallelLoad` Is Removed
- Resolved