hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java
changeset 360 21d113ecbf6a
parent 1 489c9b5090e2
child 670 ddf3e9583f2f
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java	Fri Apr 11 09:56:35 2008 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java	Sun Apr 13 17:43:42 2008 -0400
@@ -64,8 +64,17 @@
     List list = getElements();
     ObjectHistogramElement.titleOn(tty);
     Iterator iterator = list.listIterator();
+    int num=0;
+    int totalCount=0;
+    int totalSize=0;
     while (iterator.hasNext()) {
-      ((ObjectHistogramElement) iterator.next()).printOn(tty);
+      ObjectHistogramElement el = (ObjectHistogramElement) iterator.next();
+      num++;
+      totalCount+=el.getCount();
+      totalSize+=el.getSize();
+      tty.print(num + ":" + "\t\t");
+      el.printOn(tty);
     }
+    tty.println("Total : " + "\t" + totalCount + "\t" + totalSize);
   }
 }