-
Notifications
You must be signed in to change notification settings - Fork 61
8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage() #39
Conversation
👋 Welcome back sjohanss! A progress list of the required criteria for merging this PR into |
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.
Looks good. Thanks for fixing!
@kstefanj 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 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Thanks for the reviews @stefank and @albertnetymk |
Going to push as commit c47e64e.
Your commit was automatically rebased without conflicts. |
Please review this bugfix to ensure a consistent
MemoryUsage
object is returned when usingMemoryMXBean.getHeapMemoryUsage()
Summary
In ZGC the
MemoryUsage
returned was created using the base implementation inCollectedHead
. This implementation just queries the underlying heap forused
,capacity
andmax_capacity
, and since these values can be updated concurrently with ZGC we need to have a specialized implementation that handles this to ensure consistent values are returned. Such implementation is already present and used when the usage is quired through aMemoryPool
, so this change just re-uses that.Testing
Verified locally that this fixes the test that previously failed.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk20 pull/39/head:pull/39
$ git checkout pull/39
Update a local copy of the PR:
$ git checkout pull/39
$ git pull https://git.openjdk.org/jdk20 pull/39/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 39
View PR using the GUI difftool:
$ git pr show -t 39
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk20/pull/39.diff