6718125: SA: jmap prints negative size for MaxNewHeap

Fixed printing of negative value for MaxNewHeap.

Reviewed-by: jjh
This commit is contained in:
Swamy Venkataramanappa 2008-08-12 12:44:22 -07:00
parent 6144fe8e3e
commit 14b6adc782

View File

@ -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) {