< prev index next >

src/hotspot/share/memory/metaspace.cpp

Print this page
rev 49926 : [mq]: 8201572-improve-metaspace-reporting
rev 49927 : imported patch 8201572-improve-metaspace-reporting-delta

@@ -4084,26 +4084,36 @@
   out->cr();
   out->print("Waste: ");
   // For all wastages, print percentages from total. As total use the total size of memory committed for metaspace.
   const size_t committed_words = committed_bytes() / BytesPerWord;
 
-  out->print("(Percentage values refer to total committed size (");
+  out->print("Percentage values refer to total committed size ");
   print_scaled_words(out, committed_words, scale);
   out->print_cr(").");
 
+  // Print space committed but not yet used by any class loader
+  const size_t unused_words_in_vs = MetaspaceUtils::free_in_vs_bytes() / BytesPerWord;
+  out->print("              Committed unused: ");
+  print_scaled_words_and_percentage(out, unused_words_in_vs, committed_words, scale, 6);
+  out->cr();
+
   // Print waste for in-use chunks.
   UsedChunksStatistics ucs_nonclass = cl._stats_total.nonclass_sm_stats().totals();
   UsedChunksStatistics ucs_class = cl._stats_total.class_sm_stats().totals();
   UsedChunksStatistics ucs_all;
   ucs_all.add(ucs_nonclass);
   ucs_all.add(ucs_class);
+
   out->print("        Waste in chunks in use: ");
   print_scaled_words_and_percentage(out, ucs_all.waste(), committed_words, scale, 6);
   out->cr();
   out->print("         Free in chunks in use: ");
   print_scaled_words_and_percentage(out, ucs_all.free(), committed_words, scale, 6);
   out->cr();
+  out->print("     Overhead in chunks in use: ");
+  print_scaled_words_and_percentage(out, ucs_all.overhead(), committed_words, scale, 6);
+  out->cr();
 
   // Print waste in free chunks.
   const size_t total_capacity_in_free_chunks =
       Metaspace::chunk_manager_metadata()->free_chunks_total_words() +
      (Metaspace::using_class_space() ? Metaspace::chunk_manager_class()->free_chunks_total_words() : 0);

@@ -4116,12 +4126,20 @@
       cl._stats_total.nonclass_sm_stats().free_blocks_num() +
       cl._stats_total.class_sm_stats().free_blocks_num();
   const size_t free_blocks_cap_words =
       cl._stats_total.nonclass_sm_stats().free_blocks_cap_words() +
       cl._stats_total.class_sm_stats().free_blocks_cap_words();
-  out->print("Deallocated from chunks in use: " UINTX_FORMAT " blocks, total size ", free_blocks_num);
+  out->print("Deallocated from chunks in use: ");
   print_scaled_words_and_percentage(out, free_blocks_cap_words, committed_words, scale, 6);
+  out->print(" ("UINTX_FORMAT " blocks)", free_blocks_num);
+  out->cr();
+
+  // Print total waste.
+  const size_t total_waste = ucs_all.waste() + ucs_all.free() + ucs_all.overhead() + total_capacity_in_free_chunks
+      + free_blocks_cap_words + unused_words_in_vs;
+  out->print("                       -total-: ");
+  print_scaled_words_and_percentage(out, total_waste, committed_words, scale, 6);
   out->cr();
 
   // Print internal statistics
 #ifdef ASSERT
   out->cr();
< prev index next >