Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
/ jdk20 Public archive

8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage() #39

Closed
wants to merge 2 commits into from

Conversation

kstefanj
Copy link
Contributor

@kstefanj kstefanj commented Dec 15, 2022

Please review this bugfix to ensure a consistent MemoryUsageobject is returned when using MemoryMXBean.getHeapMemoryUsage()

Summary
In ZGC the MemoryUsage returned was created using the base implementation in CollectedHead. This implementation just queries the underlying heap for used, capacityand max_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 a MemoryPool, so this change just re-uses that.

Testing
Verified locally that this fixes the test that previously failed.


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-8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage()

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 15, 2022

👋 Welcome back sjohanss! 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 openjdk bot added the rfr Pull request is ready for review label Dec 15, 2022
@kstefanj kstefanj changed the title 8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeap… 8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage() Dec 15, 2022
@openjdk
Copy link

openjdk bot commented Dec 15, 2022

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

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Dec 15, 2022
@mlbridge
Copy link

mlbridge bot commented Dec 15, 2022

Webrevs

Copy link
Member

@stefank stefank left a 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!

@openjdk
Copy link

openjdk bot commented Dec 15, 2022

@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:

8297979: ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage()

Reviewed-by: stefank, ayang

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 master branch:

  • 48f6127: 8298376: ZGC: thaws stackChunk with stale oops
  • 22a6b59: 8298727: Trees.getPath may crash for unnamed package
  • 323e574: 8298371: monitors_on_stack extracts unprocessed oops

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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 15, 2022
@kstefanj
Copy link
Contributor Author

Thanks for the reviews @stefank and @albertnetymk
/integrate

@openjdk
Copy link

openjdk bot commented Dec 16, 2022

Going to push as commit c47e64e.
Since your change was applied there have been 7 commits pushed to the master branch:

  • 03a694a: 8298083: The "CheckBox/RadioButton[Enabled/Disabled].textForeground" stoped working
  • c7d7e7e: 8298888: ProblemList gc/g1/TestVerifyGCType.java on linux and macosx
  • ca39eb9: 7093322: (fs spec) Files.newBufferedWriter should be clear when coding errors are detected
  • 2c42499: 8298050: Add links to graph output for javadoc
  • 48f6127: 8298376: ZGC: thaws stackChunk with stale oops
  • 22a6b59: 8298727: Trees.getPath may crash for unnamed package
  • 323e574: 8298371: monitors_on_stack extracts unprocessed oops

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 16, 2022
@openjdk openjdk bot closed this Dec 16, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 16, 2022
@openjdk
Copy link

openjdk bot commented Dec 16, 2022

@kstefanj Pushed as commit c47e64e.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants