< prev index next >

src/hotspot/share/services/memReporter.cpp

Print this page
rev 49895 : [mq]: 8201572-improve-metaspace-reporting


 184       if (Metaspace::using_class_space()) {
 185         report_metadata(Metaspace::ClassType);
 186       }
 187     }
 188     out->print_cr(" ");
 189   }
 190 }
 191 
 192 void MemSummaryReporter::report_metadata(Metaspace::MetadataType type) const {
 193   assert(type == Metaspace::NonClassType || type == Metaspace::ClassType,
 194     "Invalid metadata type");
 195   const char* name = (type == Metaspace::NonClassType) ?
 196     "Metadata:   " : "Class space:";
 197 
 198   outputStream* out = output();
 199   const char* scale = current_scale();
 200   size_t committed   = MetaspaceUtils::committed_bytes(type);
 201   size_t used = MetaspaceUtils::used_bytes(type);
 202   size_t free = (MetaspaceUtils::capacity_bytes(type) - used)
 203               + MetaspaceUtils::free_chunks_total_bytes(type)
 204               + MetaspaceUtils::free_bytes(type);
 205 
 206   assert(committed >= used + free, "Sanity");
 207   size_t waste = committed - (used + free);
 208 
 209   out->print_cr("%27s (  %s)", " ", name);
 210   out->print("%27s (    ", " ");
 211   print_total(MetaspaceUtils::reserved_bytes(type), committed);
 212   out->print_cr(")");
 213   out->print_cr("%27s (    used=" SIZE_FORMAT "%s)", " ", amount_in_current_scale(used), scale);
 214   out->print_cr("%27s (    free=" SIZE_FORMAT "%s)", " ", amount_in_current_scale(free), scale);
 215   out->print_cr("%27s (    waste=" SIZE_FORMAT "%s =%2.2f%%)", " ", amount_in_current_scale(waste),
 216     scale, ((float)waste * 100)/committed);
 217 }
 218 
 219 void MemDetailReporter::report_detail() {
 220   // Start detail report
 221   outputStream* out = output();
 222   out->print_cr("Details:\n");
 223 
 224   report_malloc_sites();




 184       if (Metaspace::using_class_space()) {
 185         report_metadata(Metaspace::ClassType);
 186       }
 187     }
 188     out->print_cr(" ");
 189   }
 190 }
 191 
 192 void MemSummaryReporter::report_metadata(Metaspace::MetadataType type) const {
 193   assert(type == Metaspace::NonClassType || type == Metaspace::ClassType,
 194     "Invalid metadata type");
 195   const char* name = (type == Metaspace::NonClassType) ?
 196     "Metadata:   " : "Class space:";
 197 
 198   outputStream* out = output();
 199   const char* scale = current_scale();
 200   size_t committed   = MetaspaceUtils::committed_bytes(type);
 201   size_t used = MetaspaceUtils::used_bytes(type);
 202   size_t free = (MetaspaceUtils::capacity_bytes(type) - used)
 203               + MetaspaceUtils::free_chunks_total_bytes(type)
 204               + MetaspaceUtils::free_in_vs_bytes(type);
 205 
 206   assert(committed >= used + free, "Sanity");
 207   size_t waste = committed - (used + free);
 208 
 209   out->print_cr("%27s (  %s)", " ", name);
 210   out->print("%27s (    ", " ");
 211   print_total(MetaspaceUtils::reserved_bytes(type), committed);
 212   out->print_cr(")");
 213   out->print_cr("%27s (    used=" SIZE_FORMAT "%s)", " ", amount_in_current_scale(used), scale);
 214   out->print_cr("%27s (    free=" SIZE_FORMAT "%s)", " ", amount_in_current_scale(free), scale);
 215   out->print_cr("%27s (    waste=" SIZE_FORMAT "%s =%2.2f%%)", " ", amount_in_current_scale(waste),
 216     scale, ((float)waste * 100)/committed);
 217 }
 218 
 219 void MemDetailReporter::report_detail() {
 220   // Start detail report
 221   outputStream* out = output();
 222   out->print_cr("Details:\n");
 223 
 224   report_malloc_sites();


< prev index next >