< prev index next >

src/share/vm/memory/heapInspection.cpp

Print this page

        

@@ -224,13 +224,12 @@
 
 int KlassInfoHisto::sort_helper(KlassInfoEntry** e1, KlassInfoEntry** e2) {
   return (*e1)->compare(*e1,*e2);
 }
 
-KlassInfoHisto::KlassInfoHisto(KlassInfoTable* cit, const char* title) :
-  _cit(cit),
-  _title(title) {
+KlassInfoHisto::KlassInfoHisto(KlassInfoTable* cit) :
+  _cit(cit) {
   _elements = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<KlassInfoEntry*>(_histo_initial_size, true);
 }
 
 KlassInfoHisto::~KlassInfoHisto() {
   delete _elements;

@@ -646,11 +645,12 @@
 void KlassInfoHisto::print_histo_on(outputStream* st, bool print_stats,
                                     bool csv_format, const char *columns) {
   if (print_stats) {
     print_class_stats(st, csv_format, columns);
   } else {
-    st->print_cr("%s",title());
+    st->print_cr(" num     #instances         #bytes  class name");
+    st->print_cr("----------------------------------------------");
     print_elements(st);
   }
 }
 
 class HistoClosure : public KlassInfoClosure {

@@ -727,14 +727,11 @@
                    " total instances in data below",
                    missed_count);
     }
 
     // Sort and print klass instance info
-    const char *title = "\n"
-              " num     #instances         #bytes  class name\n"
-              "----------------------------------------------";
-    KlassInfoHisto histo(&cit, title);
+    KlassInfoHisto histo(&cit);
     HistoClosure hc(&histo);
 
     cit.iterate(&hc);
 
     histo.sort();
< prev index next >