RFR: 8332125: [nmt] Totals in diff report should print out total malloc and mmap diffs [v3]

Thomas Stuefe stuefe at openjdk.org
Mon Jun 24 15:31:16 UTC 2024


On Mon, 24 Jun 2024 15:08:33 GMT, Sonia Zaldana Calles <szaldana at openjdk.org> wrote:

>> Hi all, 
>> 
>> This PR addresses [8332125](https://bugs.openjdk.org/browse/JDK-8332125) enabling printing total malloc and mmap diffs when printing an NMT diff report. 
>> 
>> Testing: 
>> - [x] Added test case passes. 
>> 
>> Thanks, 
>> Sonia
>
> Sonia Zaldana Calles has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
> 
>  - Merge master
>  - Merge branch 'openjdk:master' into JDK-8332125
>  - 8332125: [nmt] Totals in diff report should print out total malloc and mmap diffs

test/hotspot/jtreg/runtime/NMT/TotalMallocMmapDiffTest.java line 92:

> 90:     private static long getMallocDiff(OutputAnalyzer output) {
> 91:         // First match should be global malloc diff
> 92:         String malloc = output.firstMatch("malloc=\\d* \\+\\d*");

Suggestion:

        String malloc = output.firstMatch("malloc=\\d+ \+(\\d+)", 1);
        return Long.parseLong(malloc);

(not tested :)

Please make sure jcmd is started here with scale=1 (just to be sure, I guess it does; test would have failed otherwise because of the SI units)

test/hotspot/jtreg/runtime/NMT/TotalMallocMmapDiffTest.java line 98:

> 96:     private static long getReservedDiff(OutputAnalyzer output) {
> 97:         // First match should be global mmap diff
> 98:         String reservedDiff = output.firstMatch("mmap: reserved=\\d* \\+\\d*");

Same

test/hotspot/jtreg/runtime/NMT/TotalMallocMmapDiffTest.java line 104:

> 102:     private static long getCommittedDiff(OutputAnalyzer output) {
> 103:         // First match should be global mmap diff
> 104:         String committedDiff = output.firstMatch("mmap: reserved=\\d* \\+\\d*, committed=\\d* \\+\\d*");

Can do the same here, probably

Suggestion:

        String s = output.firstMatch("mmap: reserved=\\d+ \+\\d+, committed=\\d+ \+(\\d+)", 1);
        return Long.parseLong(s);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19373#discussion_r1651216509
PR Review Comment: https://git.openjdk.org/jdk/pull/19373#discussion_r1651216936
PR Review Comment: https://git.openjdk.org/jdk/pull/19373#discussion_r1651228938


More information about the hotspot-runtime-dev mailing list