Skip to content

8383832: AOTMode=required fails with "incompatible CompressedOops::base()"#31171

Open
iklam wants to merge 5 commits into
openjdk:masterfrom
iklam:8383832-aot-compatible-oop-compression
Open

8383832: AOTMode=required fails with "incompatible CompressedOops::base()"#31171
iklam wants to merge 5 commits into
openjdk:masterfrom
iklam:8383832-aot-compatible-oop-compression

Conversation

@iklam
Copy link
Copy Markdown
Member

@iklam iklam commented May 15, 2026

Problem

In an AOT production run with -XX:AOTMode=required (or with the alias -XX:AOTMode=on), the JVM sometimes fail to start with the message:

[0.022s][error][aot,codecache,init] AOT Code Cache disabled: incompatible CompressedOops::base(): 0x0 vs current 0xa5a800000

This means that the AOT cache was created when the heap range is below 32GB, but in the production run, the heap is allocated above 32GB.

Solution:

Add a diagnostic option -XX:+AOTCompatibleOopCompression. This will force the HeapBasedNarrowOop to be used in both AOT assembly and production, so the AOT code cache is always compatible with the production run.

If you are planning to use -XX:AOTMode=required as a "fail-fast debugging aid" (see this note in the man page), your AOT cache should be created with -XX:+AOTCompatibleOopCompression



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8383832: AOTMode=required fails with "incompatible CompressedOops::base()" (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31171/head:pull/31171
$ git checkout pull/31171

Update a local copy of the PR:
$ git checkout pull/31171
$ git pull https://git.openjdk.org/jdk.git pull/31171/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31171

View PR using the GUI difftool:
$ git pr show -t 31171

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31171.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 15, 2026

👋 Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added the hotspot hotspot-dev@openjdk.org label May 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

@iklam The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 15, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 15, 2026

Webrevs

Copy link
Copy Markdown
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a drive-by comment.

Comment on lines +128 to +129
"Always use HeapBasedNarrowOop mode, so that AOT code can be " \
"always work regardless of runtime heap range") \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Always use HeapBasedNarrowOop mode, so that AOT code can be " \
"always work regardless of runtime heap range") \
"Always use HeapBasedNarrowOop mode, so that AOT code will " \
"always work regardless of runtime heap range") \

"Use 32-bit object references in 64-bit VM. " \
"lp64_product means flag is always constant in 32 bit VM") \
\
product(bool, AOTCompatibleOopCompression, false, DIAGNOSTIC, \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the description and usage of this it does not seem to be a diagnostic flag at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants