From 14b6adc7829e8b7f81cc093686c268229fad5a9e Mon Sep 17 00:00:00 2001 From: Swamy Venkataramanappa Date: Tue, 12 Aug 2008 12:44:22 -0700 Subject: [PATCH] 6718125: SA: jmap prints negative size for MaxNewHeap Fixed printing of negative value for MaxNewHeap. Reviewed-by: jjh --- .../share/classes/sun/jvm/hotspot/tools/HeapSummary.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index 039fc37e027..e50b6b2d089 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -193,8 +193,12 @@ public class HeapSummary extends Tool { private static final double FACTOR = 1024*1024; private void printValMB(String title, long value) { - double mb = value / FACTOR; - System.out.println(alignment + title + value + " (" + mb + "MB)"); + if (value < 0) { + System.out.println(alignment + title + (value >>> 20) + " MB"); + } else { + double mb = value/FACTOR; + System.out.println(alignment + title + value + " (" + mb + "MB)"); + } } private void printValue(String title, long value) {