Skip to content

Conversation

@SoniaZaldana
Copy link
Member

@SoniaZaldana SoniaZaldana commented May 10, 2024

Hi all,

This PR addresses 8331858 enabling the "statistics" sub-option for jcmd VM.native_memory.

Since 8256844, preinit state gets printed under "statistics" and this is also relevant for the summary state.

Testing:

  • Added test case passes.

Thanks!


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-8331858: [nmt] VM.native_memory statistics should work in summary mode (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19179/head:pull/19179
$ git checkout pull/19179

Update a local copy of the PR:
$ git checkout pull/19179
$ git pull https://git.openjdk.org/jdk.git pull/19179/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19179

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19179.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 10, 2024

👋 Welcome back szaldana! 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
Copy link

openjdk bot commented May 10, 2024

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

8331858: [nmt] VM.native_memory statistics should work in summary mode

Reviewed-by: stuefe, jsjolen

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 74 new commits pushed to the master branch:

  • 4ba7447: 8326957: Implement JEP 474: ZGC: Generational Mode by Default
  • 7ce4a13: 8332130: RISC-V: remove wrong instructions of Vector Crypto Extension
  • ea5eb74: 8326404: Assertion error when trying to compile switch with fallthrough with pattern
  • beea530: 8331907: BigInteger and BigDecimal should use optimized division
  • 440782e: 8331466: Problemlist serviceability/dcmd/gc/RunFinalizationTest.java on generic-all
  • 5ded8da: 8332085: Remove 10 year old transition check in GenerateCurrencyData tool
  • 7c2c24f: 8261433: Better pkcs11 performance for libpkcs11:C_EncryptInit/libpkcs11:C_DecryptInit
  • ff4bf1c: 8332102: Add @since to package-info of jdk.security.jarsigner
  • abf54bb: 8332100: Add missing @since to KeyValue::EC_TYPE in java.xml.crypto
  • 1484153: 8332080: Update troff man page for javadoc
  • ... and 64 more: https://git.openjdk.org/jdk/compare/524aaad98317b1a50453e5a9a44922f481fb3b1e...master

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 (@tstuefe, @jdksjolen) 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
Copy link

openjdk bot commented May 10, 2024

@SoniaZaldana The following label will be automatically applied to this pull request:

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label May 10, 2024
@SoniaZaldana SoniaZaldana marked this pull request as ready for review May 10, 2024 15:30
@openjdk openjdk bot added the rfr Pull request is ready for review label May 10, 2024
@mlbridge
Copy link

mlbridge bot commented May 10, 2024

Webrevs

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.

Thanks for doing this. Minor nits, okay otherwise.

* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023 SAP SE. All rights reserved.
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024 SAP SE. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Please only adjust Oracle or RedHat copyrights, not from other companies

} else if (_statistics.value()) {
if (check_detail_tracking_level(output())) {
NMT_TrackingLevel tracking = MemTracker::tracking_level();
if (tracking == NMT_detail || tracking == NMT_summary) {
Copy link
Member

Choose a reason for hiding this comment

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

I think there is an "is_enabled" method in MemTracker that checks for both states. Please use that.

if (tracking == NMT_detail || tracking == NMT_summary) {
MemTracker::tuning_statistics(output());
} else {
output()->print_cr("Detail or summary tracking is not enabled");
Copy link
Member

Choose a reason for hiding this comment

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

I'd just say "NMT not enabled"

@SoniaZaldana
Copy link
Member Author

Thanks @tstuefe! I made the updates.

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.

Good for me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 11, 2024
Comment on lines +149 to 160
out->print_cr("State: %s",
NMTUtil::tracking_level_to_string(_tracking_level));
if (_tracking_level == NMT_detail) {
out->print_cr("Malloc allocation site table size: %d",
MallocSiteTable::hash_buckets());
out->print_cr(" Tracking stack depth: %d",
NMT_TrackingStackDepth);
out->cr();
MallocSiteTable::print_tuning_statistics(out);
out->cr();
}
out->print_cr("Preinit state:");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any functional difference here or is it only changing indentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @jdksjolen, are you referring to the indentation printing the tracking level? I can definitely revert the indentation there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, I see, you added an if branch there! It was hard to see with the styling change on top. I think it's fine as is.

Copy link
Member Author

Choose a reason for hiding this comment

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

No worries, thanks for the review!

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

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

Approved!

@SoniaZaldana
Copy link
Member Author

/integrate

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

openjdk bot commented May 14, 2024

@SoniaZaldana
Your change (at version 8df83d1) is now ready to be sponsored by a Committer.

@tstuefe
Copy link
Member

tstuefe commented May 14, 2024

/sponsor

@openjdk
Copy link

openjdk bot commented May 14, 2024

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

  • 4ba7447: 8326957: Implement JEP 474: ZGC: Generational Mode by Default
  • 7ce4a13: 8332130: RISC-V: remove wrong instructions of Vector Crypto Extension
  • ea5eb74: 8326404: Assertion error when trying to compile switch with fallthrough with pattern
  • beea530: 8331907: BigInteger and BigDecimal should use optimized division
  • 440782e: 8331466: Problemlist serviceability/dcmd/gc/RunFinalizationTest.java on generic-all
  • 5ded8da: 8332085: Remove 10 year old transition check in GenerateCurrencyData tool
  • 7c2c24f: 8261433: Better pkcs11 performance for libpkcs11:C_EncryptInit/libpkcs11:C_DecryptInit
  • ff4bf1c: 8332102: Add @since to package-info of jdk.security.jarsigner
  • abf54bb: 8332100: Add missing @since to KeyValue::EC_TYPE in java.xml.crypto
  • 1484153: 8332080: Update troff man page for javadoc
  • ... and 64 more: https://git.openjdk.org/jdk/compare/524aaad98317b1a50453e5a9a44922f481fb3b1e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 14, 2024
@openjdk openjdk bot closed this May 14, 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 May 14, 2024
@openjdk
Copy link

openjdk bot commented May 14, 2024

@tstuefe @SoniaZaldana Pushed as commit 5a4415a.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants