JDK-8296446 : Release Note: Deprecate and Disable Legacy Parallel Class Loading Workaround for Non-Parallel-Capable Class Loaders
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2022-11-06
  • Updated: 2022-11-07
  • Resolved: 2022-11-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20Resolved
Description
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.

Comments
Looks good!
07-11-2022

Thank you for the help with the wording, [~dholmes]
07-11-2022