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

Thomas Stuefe stuefe at openjdk.org
Fri May 10 15:40:04 UTC 2024


On Fri, 10 May 2024 15:26:40 GMT, Sonia Zaldana Calles <szaldana at openjdk.org> wrote:

> Hi all, 
> 
> This PR addresses [8331858](https://bugs.openjdk.org/browse/JDK-8331858) enabling the "statistics" sub-option for jcmd VM.native_memory. 
> 
> Since [8256844](https://bugs.openjdk.org/browse/JDK-8256844), preinit state gets printed under "statistics" and this is also relevant for the summary state. 
> 
> Testing:
> - [x] Added test case passes. 
> 
> Thanks!

Thanks for doing this. Minor nits, okay otherwise.

src/hotspot/share/nmt/memTracker.cpp line 3:

> 1: /*
> 2:  * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
> 3:  * Copyright (c) 2020, 2024 SAP SE. All rights reserved.

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

src/hotspot/share/nmt/nmtDCmd.cpp line 141:

> 139:   } else if (_statistics.value()) {
> 140:     NMT_TrackingLevel tracking = MemTracker::tracking_level();
> 141:     if (tracking == NMT_detail || tracking == NMT_summary) {

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

src/hotspot/share/nmt/nmtDCmd.cpp line 144:

> 142:       MemTracker::tuning_statistics(output());
> 143:     } else {
> 144:       output()->print_cr("Detail or summary tracking is not enabled");

I'd just say "NMT not enabled"

-------------

PR Review: https://git.openjdk.org/jdk/pull/19179#pullrequestreview-2050335105
PR Review Comment: https://git.openjdk.org/jdk/pull/19179#discussion_r1596908871
PR Review Comment: https://git.openjdk.org/jdk/pull/19179#discussion_r1596909475
PR Review Comment: https://git.openjdk.org/jdk/pull/19179#discussion_r1596909895


More information about the hotspot-runtime-dev mailing list