Skip to content

8349772: C2 hits MemLimit during incremental inlining#30555

Open
dafedafe wants to merge 3 commits intoopenjdk:masterfrom
dafedafe:JDK-8349772
Open

8349772: C2 hits MemLimit during incremental inlining#30555
dafedafe wants to merge 3 commits intoopenjdk:masterfrom
dafedafe:JDK-8349772

Conversation

@dafedafe
Copy link
Copy Markdown
Contributor

@dafedafe dafedafe commented Apr 2, 2026

The issue was very intermittent but an old run that reproduced (for the crash with -XX:-TieredCompilation -XX:+AlwaysIncrementalInline) suggested the following was happening:
The test builds a very long MH adapter chain (in some runs up to ~10,000 transformations). Many small MH adapters are late-inlined, and C2 performs repeated incremental-inline/prune/IGVN rounds.
In each round, parser/IR/support data is allocated from compile arenas. Even when pruning removes dead nodes (live node count seems to remain moderate, e.g. ~13k), arena usage appears to be reclaimed only when the compilation ends.
So, for runs with long/complex chains, peak arena usage seems to cross MemLimit, which triggers a crash in debug (or a compilation bailout in product/non-crash mode).
Disabling/stopping late inlining at that point would probably only postpone the resource failure to a later phase.
JDK-8349820 disabled the explicit test-level MemLimit override. This change keeps a safeguard by using a larger explicit limit (2G) in debug builds.

Testing: tier1-3+



Progress

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

Issue

  • JDK-8349772: C2 hits MemLimit during incremental inlining (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30555

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 2, 2026

👋 Welcome back dfenacci! 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 Apr 2, 2026

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

@openjdk openjdk bot changed the title JDK-8349772: C2 hits MemLimit during incremental inlining 8349772: C2 hits MemLimit during incremental inlining Apr 2, 2026
@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Apr 2, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 2, 2026

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

  • hotspot-compiler

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.

@dafedafe dafedafe marked this pull request as ready for review April 9, 2026 14:40
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 9, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 9, 2026

Webrevs

*
* @requires vm.debug
*
* @run main/othervm/timeout=480 -XX:CompileCommand=MemLimit,*.*,2G~crash vm.mlvm.meth.stress.compiler.i2c_c2i.Test
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.

Might as well use the new ${test.main.class} for these two @run commands.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍, fixed that.

Copy link
Copy Markdown
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

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

That looks reasonable to me.

@openjdk openjdk bot removed the rfr Pull request is ready for review label Apr 10, 2026
@dafedafe
Copy link
Copy Markdown
Contributor Author

/template append

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 10, 2026

@dafedafe The pull request template has been appended to the pull request body

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Development

Successfully merging this pull request may close these issues.

3 participants