-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8264008: Incorrect metaspace statistics after JEP 387 when UseCompressedClassPointers is off #3142
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
Conversation
…sedClassPointers is off
|
/issue add JDK-8264008 |
|
👋 Welcome back jiefu! A progress list of the required criteria for merging this PR into |
|
@DamonFool This issue is referenced in the PR title - it will now be updated. |
|
@DamonFool |
|
@DamonFool The |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this makes sense. Thanks for fixing this.
The problem is that is_class_space_allocation is ambiguous. The way it is implemented it answers the question "should this be allocated from class space". But in this statistics, it is used as a simple "is this a class space type".
What concerns me is that we did not find this earlier. Can you please add a test run for at least one of the failing tests to also execute with compressed oops off?
Even better would be an own regression test, e.g. as part of the gtests. Can be very simple, if UseCompressedClassPointers is off, MetaspaceUtils::committed_words should return 0 for class type. Then we can add another gtest run to the gtest runner jtreg tests with that option (possibly in a separate RFE).
Thanks @tstuefe for your review. A test run has been added in jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jie,
thanks for adding the test. Notes inline.
Cheers, Thomas
| * @requires vm.gc == "Serial" | vm.gc == null | ||
| * @library /test/lib /test/jdk | ||
| * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseSerialGC -XX:-UseCompressedClassPointers | ||
| * jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventDefNewSerial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would exclude 32bit here since it would just re-run the same test as above. Does the 32bit VM even accept UseCompressedClassPointers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would exclude 32bit here since it would just re-run the same test as above. Does the 32bit VM even accept UseCompressedClassPointers?
32bit has been excluded.
I don't think the 32bit VM accepts UseCompressedClassPointers and that's why there is -XX:+IgnoreUnrecognizedVMOptions in my previous patch.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
@DamonFool 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: 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 34 new commits pushed to the
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 |
Thanks @tstuefe . |
|
@DamonFool Since your change was applied there have been 38 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 06d46d6. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi @tstuefe , The gtest has been added here: #3414 . Please review it. |
Hi all,
Metaspace statistics is incorrect after JEP 387 when UseCompressedClassPointers is off.
For example, here is the incorrect metaspace statistics before the fix:
This bug can be reproduced by running the following tests with
-XX:-UseCompressedClassPointers, which would pass before JEP 387.The failing reason is that
Metaspace::is_class_space_allocation(mdtype)[1] will always return false whenUseCompressedClassPointersis off.So
RunningCounters::committed_words_nonclass()will be returned even called withMetaspace::is_class_space_allocation(Metaspace::ClassType), which is unreasonable.And
MetaspaceUtils::reserved_words(Metaspace::MetadataType mdtype)/MetaspaceUtils::used_words(Metaspace::MetadataType mdtype)also suffer from the same bug.Thanks.
Best regards,
Jie
[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/memory/metaspace.cpp#L90
Metaspace statistics after the fix:
Progress
Issue
Reviewers
Download
To checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3142/head:pull/3142$ git checkout pull/3142To update a local copy of the PR:
$ git checkout pull/3142$ git pull https://git.openjdk.java.net/jdk pull/3142/head