-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8254012: NMT: MetaspaceSnapshot::snapshot uses wrong enum #645
Conversation
👋 Welcome back minqi! A progress list of the required criteria for merging this PR into |
I wonder why this bug has not been discovered until now. It seems like the old code would not work at all when compressed class space is disabled. Do we have any test cases for it? Or, is this feature actually used? |
MetaspaceSnapshot predefine the _reserved_in_bytes (and other two, _commited_in_byte, _used_in_bytes) with dimension of MetadataTypeCount, the array of index ClassType is a valid slot. In this bug, if CCP is disabled, the snapshot for ClassType gets updated with zero, but non class type data is not update in snapshot. There is no output for class type data when CCP is disabled. While the original data recording is correct (at allocation) the snapshot did not get it. I will do some tests. |
This is confusing to be sure. The part that is broken by this bug is using the basline..diff functionality if compressed class space is off. All other metaspace numbers are still okay because they are printed via other code paths. Reproduction:
And no, there are no tests for that. This is an old bug. |
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, thanks for fixing.
@yminqi 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 14 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 |
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.
The change looks good // not Reviewer though.
Thanks for fixing!
Not sure how Oracle handles this usually, but maybe it makes sense to reformulate the JBS issue and describe above effect? Or, alternatively, open a new one as a duplicate to this bug? When people look into the JBS for this specific NMT bug they may not notice the harmless test error. |
/integrate |
@yminqi Since your change was applied there have been 14 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit fde02e2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this simple change.
Snapshot should be done first on NonClassType which will include ClassType allocation when Metaspace::using_class_space() is false. _class_vsm (a VirtualSpaceManager) is set only for class type allocation when using_class_space is true. The correct order is do snapshot for NonClassType first, then for ClassType if using_class_space.
Tests: mach5 tier1-4 in progress.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/645/head:pull/645
$ git checkout pull/645