Skip to content

Conversation

rsunderbabu
Copy link
Member

@rsunderbabu rsunderbabu commented Aug 19, 2025

MethodHandle invocations with Xcomp are filling up CodeCache quickly in the test, especially in machines with high number of processors.
It is possible to measure code cache consumption per invocation, estimate overall consumption and bail out before CodeCache runs out of memory.
But it is much simpler to exclude the test for Xcomp flag.

Additional Change: MethodHandles.lookup was done unnecessarily invoked for all iterations. Replaced it with single invocation.

PS: This issue is not seen in JDK 20 and above, possibly due to JDK-8290025, but the exclusion guards against vagaries of CodeCache management.


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-8286865: vmTestbase/vm/mlvm/meth/stress/jni/nativeAndMH/Test.java fails with Out of space in CodeCache (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26840

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 19, 2025

👋 Welcome back rsunderbabu! 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

openjdk bot commented Aug 19, 2025

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

@openjdk
Copy link

openjdk bot commented Aug 19, 2025

@rsunderbabu 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.

@openjdk openjdk bot added hotspot-compiler [email protected] rfr Pull request is ready for review labels Aug 19, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 19, 2025

Webrevs

Test.class,
"calledFromNative",
MT_calledFromNative);
} catch(Exception ex) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
} catch(Exception ex) {
} catch (Exception ex) {

@dean-long
Copy link
Member

-Xcomp is a useful stress flag, and this test is meant to stress MHs, not the code cache, so can we increase the code cache size enough to let it pass with -Xcomp?

@rsunderbabu
Copy link
Member Author

-Xcomp is a useful stress flag, and this test is meant to stress MHs, not the code cache, so can we increase the code cache size enough to let it pass with -Xcomp?

The number of iterations are proportional to number of CPUs. so we cannot predict the required cache size.
Another alternative is to cap the number of CPU based scaling to some number. If the number is capped, someone might doubt if we have stressed MHs enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants