--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Fri Aug 15 05:55:22 2008 +0200
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Fri Aug 15 12:05:41 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) {