Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8267348: Rewrite gc/epsilon/TestClasses.java to use Metaspace with less classes #4118

Closed
wants to merge 3 commits into from

Conversation

@shipilev
Copy link
Contributor

@shipilev shipilev commented May 19, 2021

See the bug report for discussion. The test verifies that Epsilon reacts on Metaspace resizes properly. It started to timeout since Vtable-based CHA implementation landed. The dependency checking walks a lot of classes looking at their oops, and this gets very slow with +CheckUnhandledOops. There are measures to improve CheckUnhandledOops, but we can also rewrite the test to puff up the same amount of Metaspace with less classes.

I have selected the new constants to match the same Metaspace occupancy like the original test (~25M). New code requires absorbing a few more allocations, so heap size is bumped to 1G, which is similar to other Epsilon tests.

Running with default options before:

[26.945s][info   ][gc          ] Heap: 128M reserved, 128M (100.00%) committed, 66524K (50.75%) used
[26.945s][info   ][gc,metaspace] Metaspace: 69632K reserved, 24896K (35.75%) committed, 24703K (35.48%) used

real	0m47.997s
user	1m18.188s
sys	0m4.365s

...and after:

[0.818s][info   ][gc          ] Heap: 1024M reserved, 1024M (100.00%) committed, 181M (17.68%) used
[0.818s][info   ][gc,metaspace] Metaspace: 86016K reserved, 25856K (30.06%) committed, 25732K (29.92%) used

real	0m19.919s
user	0m50.806s
sys	0m4.356s

Running with -XX:+CheckUnhandledOops before:

[394.089s][info   ][gc          ] Heap: 128M reserved, 128M (100.00%) committed, 52731K (40.23%) used
[394.089s][info   ][gc,metaspace] Metaspace: 69632K reserved, 19456K (27.94%) committed, 19267K (27.67%) used
...
<timeout>

...and after:

[1.952s][info   ][gc          ] Heap: 1024M reserved, 1024M (100.00%) committed, 180M (17.66%) used
[1.952s][info   ][gc,metaspace] Metaspace: 86016K reserved, 25856K (30.06%) committed, 25732K (29.92%) used

real	0m27.555s
user	0m57.851s
sys	0m4.645s

Additional testing:

  • Affected test with -XX:+CheckUnhandledOops

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8267348: Rewrite gc/epsilon/TestClasses.java to use Metaspace with less classes

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4118/head:pull/4118
$ git checkout pull/4118

Update a local copy of the PR:
$ git checkout pull/4118
$ git pull https://git.openjdk.java.net/jdk pull/4118/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4118

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4118.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 19, 2021

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

Loading

@openjdk
Copy link

@openjdk openjdk bot commented May 19, 2021

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

  • hotspot-gc

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.

Loading

@openjdk openjdk bot added the hotspot-gc label May 19, 2021
@shipilev shipilev marked this pull request as ready for review May 19, 2021
@openjdk openjdk bot added the rfr label May 19, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 19, 2021

Webrevs

Loading

Copy link
Member

@tstuefe tstuefe left a comment

This looks fine.

Loading

Loading
@openjdk
Copy link

@openjdk openjdk bot commented May 19, 2021

@shipilev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8267348: Rewrite gc/epsilon/TestClasses.java to use Metaspace with less classes

Reviewed-by: stuefe

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 6 new commits pushed to the master branch:

  • 74f30ad: 8263684: Avoid wrapping into BufferedWriter twice
  • 9820f3d: 8267371: Concurrent gtests take too long
  • 38d690b: 8265262: CITime - 'other' incorrectly calculated
  • 66ab6d8: 8264181: javadoc tool Incorrect error message about malformed link
  • 99fcc41: 8234532: Remove ThreadLocalAllocBuffer::_fast_refill_waste since it is never set
  • 237fee8: 8267339: Temporarily disable os.release_multi_mappings_vm on macOS x64

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label May 19, 2021
@shipilev
Copy link
Contributor Author

@shipilev shipilev commented May 20, 2021

/integrate

Loading

@openjdk openjdk bot closed this May 20, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels May 20, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 20, 2021

@shipilev Since your change was applied there have been 23 commits pushed to the master branch:

  • ca93399: 8267235: [macos_aarch64] InterpreterRuntime::throw_pending_exception messing up LR results in crash
  • b7b6acd: 8267481: Make sure table row has correct number of cells
  • f67847f: 8267396: Avoid recording "pc" in unhandled oops detector for better performance
  • 878d1b3: 8267434: Remove LinkOutput[Impl]
  • fc7f0a3: 8267480: Explicitly problemlist all runtime/os/TestTracePageSizes.java tests on linux-aarch64 to reduce noise
  • 9425d3d: 8261880: Change nested classes in java.base to static nested classes where possible
  • 459abd5: 8267219: Javadoc method summary breaks when {@inheritdoc} from an empty parent
  • aba2265: 8260267: ZGC: Reduce mark stack usage
  • f979523: 8267463: Problemlist runtime/os/TestTracePageSizes.java on linux-aarch64 to reduce noise
  • f07dcf4: 8264290: Create implementation for NSAccessibilityComponentGroup protocol peer
  • ... and 13 more: https://git.openjdk.java.net/jdk/compare/64e2479bf6e0ceccda16c076758e23e85310d524...master

Your commit was automatically rebased without conflicts.

Pushed as commit 7b98400.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

@shipilev shipilev deleted the JDK-8267348-epsilon-tests branch Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants