# HG changeset patch # User swamyv # Date 1218570262 25200 # Node ID a2de7dfbfcf09ee1d1defb3f4a8369ef594512b5 # Parent 79276d1b7e502c0402f6bd69744b1e2e3f612ce3 6718125: SA: jmap prints negative size for MaxNewHeap. Summary: Fixed printing of negative value for MaxNewHeap. Reviewed-by: jjh diff -r 79276d1b7e50 -r a2de7dfbfcf0 agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java --- a/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Sun Aug 10 21:58:54 2008 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Tue Aug 12 12:44:22 2008 -0700 @@ -193,8 +193,12 @@ 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) {