From 46e4ee1e80652203bd59d968ea72b27681bdf312 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 28 Jun 2023 14:07:58 +0000 Subject: [PATCH] 8310974: NMT: Arena diffs miss the scale Reviewed-by: zgu, stuefe --- src/hotspot/share/services/memReporter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/services/memReporter.cpp b/src/hotspot/share/services/memReporter.cpp index 7c5f37c6992..4c2a5b898dc 100644 --- a/src/hotspot/share/services/memReporter.cpp +++ b/src/hotspot/share/services/memReporter.cpp @@ -492,8 +492,9 @@ void MemSummaryDiffReporter::print_arena_diff(size_t current_amount, size_t curr const char* scale = current_scale(); outputStream* out = output(); out->print("arena=" SIZE_FORMAT "%s", amount_in_current_scale(current_amount), scale); - if (diff_in_current_scale(current_amount, early_amount) != 0) { - out->print(" " INT64_PLUS_FORMAT "d", diff_in_current_scale(current_amount, early_amount)); + int64_t amount_diff = diff_in_current_scale(current_amount, early_amount); + if (amount_diff != 0) { + out->print(" " INT64_PLUS_FORMAT "%s", amount_diff, scale); } out->print(" #" SIZE_FORMAT "", current_count);