6718125: SA: jmap prints negative size for MaxNewHeap.
authorswamyv
Tue, 12 Aug 2008 12:44:22 -0700
changeset 989 04e4dadeec8a
parent 985 5d1e7eafc504
child 990 02bac3e9892a
6718125: SA: jmap prints negative size for MaxNewHeap. Summary: Fixed printing of negative value for MaxNewHeap. Reviewed-by: jjh
hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java	Sun Aug 10 21:58:54 2008 -0700
+++ b/hotspot/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) {