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

8320061: [nmt] Multiple issues with peak accounting #481

Closed
wants to merge 3 commits into from

Conversation

Delawen
Copy link
Contributor

@Delawen Delawen commented Apr 10, 2024

This is a follow up of #440

This backport fixes several NMT things, among those, the problem with largest_committed being 0KB as shown on the previous PR.

Example of output:

$ jcmd 20088 VM.native_memory detail | grep "mmap: reserved="
                            (mmap: reserved=8388608KB, committed=618496KB, at peak) 
                            (mmap: reserved=1048576KB, committed=32064KB, at peak) 
                            (mmap: reserved=528392KB, committed=41416KB, at peak) 
                            (mmap: reserved=197140KB, committed=45380KB, at peak) 
                            (mmap: reserved=40KB, committed=36KB, at peak) 
                            (mmap: reserved=8KB, committed=8KB, at peak) 
                            (mmap: reserved=262144KB, committed=224640KB, at peak) 
                            (mmap: reserved=0KB, committed=0KB, peak=20KB) 

As described in the original PR, other features in this PR is fixing the scale so it also shows when the allocation value is zero (note the GB now instead of showing KB as before, and the 0GB that is shown):

$ jcmd 20088 VM.native_memory detail scale=g | grep "committed"
Total: reserved=11GB, committed=2GB
       mmap:   reserved=10GB, committed=1GB
-                 Java Heap (reserved=8GB, committed=1GB)
                            (mmap: reserved=8GB, committed=1GB, at peak) 
-                     Class (reserved=1GB, committed=0GB)
                            (mmap: reserved=1GB, committed=0GB, at peak) 
                            (    reserved=0GB, committed=0GB)
                            (    reserved=1GB, committed=0GB)
-                      Code (reserved=1GB, committed=0GB)
                            (mmap: reserved=1GB, committed=0GB, at peak) 
-                     Other (reserved=1GB, committed=1GB)
	[0x00000005c0000000 - 0x0000000601c00000] committed 1GB from
                             (reserved=8GB, committed=1GB Type=Java Heap)
                             (reserved=1GB, committed=0GB Type=Class)
                             (reserved=1GB, committed=0GB Type=Code)

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8320061 needs maintainer approval
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8320061: [nmt] Multiple issues with peak accounting (Enhancement - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/481/head:pull/481
$ git checkout pull/481

Update a local copy of the PR:
$ git checkout pull/481
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/481/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 481

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/481.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 10, 2024

👋 Welcome back Delawen! A progress list of the required criteria for merging this PR into pr/440 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Apr 10, 2024

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

8320061: [nmt] Multiple issues with peak accounting

Reviewed-by: shade, 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 8 new commits pushed to the master branch:

  • 1d01cd7: 8315889: Open source several Swing HTMLDocument related tests
  • 2331bc7: 8329013: StackOverflowError when starting Apache Tomcat with signed jar
  • 68d0925: 8324933: ConcurrentHashTable::statistics_calculate synchronization is expensive
  • 2626d73: 8327989: java/net/httpclient/ManyRequest.java should not use "localhost" in URIs
  • 9c0e18c: 8320924: Improve heap dump performance by optimizing archived object checks
  • 41237fc: 8320707: Virtual thread test updates
  • 955fcc1: 8310355: Move the stub test from initialize_final_stubs() to test/hotspot/gtest
  • 031acf1: 8327096: (fc) java/nio/channels/FileChannel/Size.java fails on partition incapable of creating large files

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@shipilev, @tstuefe) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport dc256fbc6490f8163adb286dbb7380c10e5e1e06 8320061: [nmt] Multiple issues with peak accounting Apr 10, 2024
@openjdk
Copy link

openjdk bot commented Apr 10, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Apr 10, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 10, 2024

Webrevs

@Delawen
Copy link
Contributor Author

Delawen commented Apr 10, 2024

/clean

This is a clean merge to another open PR.

@openjdk
Copy link

openjdk bot commented Apr 10, 2024

@Delawen Only OpenJDK Committers can use the /clean command

@openjdk-notifier openjdk-notifier bot changed the base branch from pr/440 to master April 23, 2024 10:58
@openjdk-notifier
Copy link

The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout backport-JDK-8320061
git fetch https://git.openjdk.org/jdk21u-dev.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superficially, this looks good. @tstuefe should ack as well.

Have you ran runtime/NMT tests with this PR?

@shipilev
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Apr 23, 2024

⚠️ @Delawen This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk
Copy link

openjdk bot commented Apr 23, 2024

@shipilev
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@Delawen
Copy link
Contributor Author

Delawen commented Apr 23, 2024

Tests are being run on the github jobs right now. Once they are done I will do the approval command. Thanks @shipilev !

@shipilev
Copy link
Member

Tests are being run on the github jobs right now. Once they are done I will do the approval command. Thanks @shipilev !

It would be safer to run runtime/NMT locally, without relying on GHA to include all of them. Since this PR is modifies the tests, it is expected that you verify all of them still work reliably :)

@Delawen
Copy link
Contributor Author

Delawen commented Apr 23, 2024

Sure, then I will run them now :)

(I did it on the original PR commit but it's true, a merge that big deserves another try)

@Delawen
Copy link
Contributor Author

Delawen commented Apr 23, 2024

Tests passed.

Also I checked again the output of the following commands:

$ jcmd 2847003 VM.native_memory detail | grep "mmap: reserved="
                            (mmap: reserved=8388608KB, committed=1236992KB, at peak) 
                            (mmap: reserved=1048576KB, committed=40384KB, at peak) 
                            (mmap: reserved=528392KB, committed=68440KB, at peak) 
                            (mmap: reserved=197140KB, committed=57460KB, at peak) 
                            (mmap: reserved=40KB, committed=36KB, at peak) 
                            (mmap: reserved=8KB, committed=8KB, at peak) 
                            (mmap: reserved=327680KB, committed=276224KB, at peak) 
                            (mmap: reserved=0KB, committed=0KB, peak=20KB) 
$ jcmd 2847003 VM.native_memory detail scale=g | grep "committed"
Total: reserved=11GB, committed=3GB
       mmap:   reserved=10GB, committed=2GB
-                 Java Heap (reserved=8GB, committed=1GB)
                            (mmap: reserved=8GB, committed=1GB, at peak) 
-                     Class (reserved=1GB, committed=0GB)
                            (mmap: reserved=1GB, committed=0GB, at peak) 
                            (    reserved=0GB, committed=0GB)
                            (    reserved=1GB, committed=0GB)
-                      Code (reserved=1GB, committed=0GB)
                            (mmap: reserved=1GB, committed=0GB, at peak) 
-                     Other (reserved=1GB, committed=1GB)
	[0x00000005c0000000 - 0x000000060c800000] committed 1GB from
                             (reserved=8GB, committed=1GB Type=Java Heap)
                             (reserved=1GB, committed=0GB Type=Class)
                             (reserved=1GB, committed=0GB Type=Code)

@Delawen
Copy link
Contributor Author

Delawen commented Apr 23, 2024

/approval JDK-8320061 request Fix Request
This is a backport for https://bugs.openjdk.org/browse/JDK-8320061 ( [nmt] Multiple issues with peak accounting ). This backport fixes several NMT things, among those, the problem with largest_committed being 0KB as shown on the previous PR.

@openjdk
Copy link

openjdk bot commented Apr 23, 2024

@Delawen
JDK-8320061: The approval request has been created successfully.

@openjdk openjdk bot added approval and removed approval labels Apr 23, 2024
@Delawen
Copy link
Contributor Author

Delawen commented Apr 24, 2024

@tstuefe can you take a look here?

@tstuefe
Copy link
Member

tstuefe commented Apr 26, 2024

Hi @Delawen,

thank you for doing this. Can you describe what parts of the patch you had to adapt, in order to make my review easier? Were the needed changes trivial, e.g. only comments?

@Delawen
Copy link
Contributor Author

Delawen commented Apr 26, 2024

I didn't have to change much, just fixing a couple of trivial merge conflicts (line numbers changed and that made git ask if it was right).

It is mostly the original backport. If you compare the original commit and this one you will see the changes shown are the same.

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tstuefe
Copy link
Member

tstuefe commented Apr 26, 2024

I didn't have to change much, just fixing a couple of trivial merge conflicts (line numbers changed and that made git ask if it was right).

It is mostly the original backport. If you compare the original commit and this one you will see the changes shown are the same.

Thanks, looks good. I wish we had a tool for showing the manual changes after such a merge.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 26, 2024
@Delawen
Copy link
Contributor Author

Delawen commented Apr 26, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 26, 2024
@openjdk
Copy link

openjdk bot commented Apr 26, 2024

@Delawen
Your change (at version 77ac5fe) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Member

Thanks both! Let's do this.

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 26, 2024

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

  • 1d01cd7: 8315889: Open source several Swing HTMLDocument related tests
  • 2331bc7: 8329013: StackOverflowError when starting Apache Tomcat with signed jar
  • 68d0925: 8324933: ConcurrentHashTable::statistics_calculate synchronization is expensive
  • 2626d73: 8327989: java/net/httpclient/ManyRequest.java should not use "localhost" in URIs
  • 9c0e18c: 8320924: Improve heap dump performance by optimizing archived object checks
  • 41237fc: 8320707: Virtual thread test updates
  • 955fcc1: 8310355: Move the stub test from initialize_final_stubs() to test/hotspot/gtest
  • 031acf1: 8327096: (fc) java/nio/channels/FileChannel/Size.java fails on partition incapable of creating large files

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 26, 2024
@openjdk openjdk bot closed this Apr 26, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 26, 2024
@openjdk
Copy link

openjdk bot commented Apr 26, 2024

@shipilev @Delawen Pushed as commit 262cacb.

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

@Delawen Delawen deleted the backport-JDK-8320061 branch April 26, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants