JDK-8348752 : Enable -XX:+AOTClassLinking by default when -XX:AOTMode is specified
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-01-28
  • Updated: 2025-01-31
  • Resolved: 2025-01-29
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 24 JDK 25
24Fixed 25 b08Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Description
According to the CSR JDK-8339506 (for https://openjdk.org/jeps/483)

"When an AOT cache is created with the new -XX:AOTMode=create flag, we assume that the application is aware of AOT class linking and does not depend of the class loading order. In this case, AOTClassLinking has a default value of true. The user can disable it by explicitly passing -XX:-AOTClassLinking in the JVM command line."

However, this is not true:

$ java -XX:AOTMode=record -XX:AOTConfiguration=test.aotconfig --version
java 24-ea 2025-03-18
Java(TM) SE Runtime Environment (build 24-ea+30-3590)
Java HotSpot(TM) 64-Bit Server VM (build 24-ea+30-3590, mixed mode, sharing)
$ java -XX:AOTMode=create -XX:AOTConfiguration=test.aotconfig -XX:AOTCache=test.aot -XX:+PrintFlagsFinal | grep AOTClassLinking
     bool AOTClassLinking                          = false                                     {product} {default}
$ java -XX:AOTMode=auto -Xlog:cds -XX:AOTCache=test.aot --version | grep Using.AOT
[0.006s][info][cds] Using AOT-linked classes: false (static archive: no aot-linked classes)

======================
Work around: explicitly specify -XX:+AOTClassLinking when using -XX:AOTMode=create

Comments
A pull request was submitted for review. Branch: jdk24 URL: https://git.openjdk.org/jdk/pull/23354 Date: 2025-01-29 17:18:01 +0000
29-01-2025

Fix request for JDK 24 approved.
29-01-2025

Changeset: d266ca96 Branch: master Author: Ioi Lam <iklam@openjdk.org> Date: 2025-01-29 16:52:10 +0000 URL: https://git.openjdk.org/jdk/commit/d266ca965d214f54c1ab16c1863f87728542b3e0
29-01-2025

Fix Request (JDK 24) This fixes a violation of the specification defined in JEP 483 (JDK-8315737). The fix is low risk as we have already tested the combination of "-XX:AOTMode:create -XX:+AOTClassLinking" extensively in the test pipeline. Fix will be reviewed and tested in tier1-9 + (AOT+JCK) testing, before integration.
29-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23341 Date: 2025-01-28 19:23:26 +0000
28-01-2025

Draft PR: https://github.com/openjdk/jdk/pull/23323
28-01-2025