hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp
changeset 31592 43f48e165466
parent 30764 fec48bf5a827
child 34299 3fdfdda0ac1f
equal deleted inserted replaced
31401:1514c0a798d2 31592:43f48e165466
   185 
   185 
   186   size_t code_root_mem_size() const { return _code_root_mem_size; }
   186   size_t code_root_mem_size() const { return _code_root_mem_size; }
   187   size_t code_root_elems() const { return _code_root_elems; }
   187   size_t code_root_elems() const { return _code_root_elems; }
   188 
   188 
   189   void print_rs_mem_info_on(outputStream * out, size_t total) {
   189   void print_rs_mem_info_on(outputStream * out, size_t total) {
   190     out->print_cr("    "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions",
   190     out->print_cr("    " SIZE_FORMAT_W(8) "K (%5.1f%%) by " SIZE_FORMAT " %s regions",
   191         round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name);
   191         round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name);
   192   }
   192   }
   193 
   193 
   194   void print_cards_occupied_info_on(outputStream * out, size_t total) {
   194   void print_cards_occupied_info_on(outputStream * out, size_t total) {
   195     out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) entries by "SIZE_FORMAT" %s regions",
   195     out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) entries by " SIZE_FORMAT " %s regions",
   196         cards_occupied(), cards_occupied_percent_of(total), amount(), _name);
   196         cards_occupied(), cards_occupied_percent_of(total), amount(), _name);
   197   }
   197   }
   198 
   198 
   199   void print_code_root_mem_info_on(outputStream * out, size_t total) {
   199   void print_code_root_mem_info_on(outputStream * out, size_t total) {
   200     out->print_cr("    "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions",
   200     out->print_cr("    " SIZE_FORMAT_W(8) "K (%5.1f%%) by " SIZE_FORMAT " %s regions",
   201         round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name);
   201         round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name);
   202   }
   202   }
   203 
   203 
   204   void print_code_root_elems_info_on(outputStream * out, size_t total) {
   204   void print_code_root_elems_info_on(outputStream * out, size_t total) {
   205     out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) elements by "SIZE_FORMAT" %s regions",
   205     out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) elements by " SIZE_FORMAT " %s regions",
   206         code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
   206         code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
   207   }
   207   }
   208 };
   208 };
   209 
   209 
   210 
   210 
   278 
   278 
   279   void print_summary_on(outputStream* out) {
   279   void print_summary_on(outputStream* out) {
   280     RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL };
   280     RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL };
   281 
   281 
   282     out->print_cr("\n Current rem set statistics");
   282     out->print_cr("\n Current rem set statistics");
   283     out->print_cr("  Total per region rem sets sizes = "SIZE_FORMAT"K."
   283     out->print_cr("  Total per region rem sets sizes = " SIZE_FORMAT "K."
   284                   " Max = "SIZE_FORMAT"K.",
   284                   " Max = " SIZE_FORMAT "K.",
   285                   round_to_K(total_rs_mem_sz()), round_to_K(max_rs_mem_sz()));
   285                   round_to_K(total_rs_mem_sz()), round_to_K(max_rs_mem_sz()));
   286     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   286     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   287       (*current)->print_rs_mem_info_on(out, total_rs_mem_sz());
   287       (*current)->print_rs_mem_info_on(out, total_rs_mem_sz());
   288     }
   288     }
   289 
   289 
   290     out->print_cr("   Static structures = "SIZE_FORMAT"K,"
   290     out->print_cr("   Static structures = " SIZE_FORMAT "K,"
   291                   " free_lists = "SIZE_FORMAT"K.",
   291                   " free_lists = " SIZE_FORMAT "K.",
   292                   round_to_K(HeapRegionRemSet::static_mem_size()),
   292                   round_to_K(HeapRegionRemSet::static_mem_size()),
   293                   round_to_K(HeapRegionRemSet::fl_mem_size()));
   293                   round_to_K(HeapRegionRemSet::fl_mem_size()));
   294 
   294 
   295     out->print_cr("    "SIZE_FORMAT" occupied cards represented.",
   295     out->print_cr("    " SIZE_FORMAT " occupied cards represented.",
   296                   total_cards_occupied());
   296                   total_cards_occupied());
   297     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   297     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   298       (*current)->print_cards_occupied_info_on(out, total_cards_occupied());
   298       (*current)->print_cards_occupied_info_on(out, total_cards_occupied());
   299     }
   299     }
   300 
   300 
   301     // Largest sized rem set region statistics
   301     // Largest sized rem set region statistics
   302     HeapRegionRemSet* rem_set = max_rs_mem_sz_region()->rem_set();
   302     HeapRegionRemSet* rem_set = max_rs_mem_sz_region()->rem_set();
   303     out->print_cr("    Region with largest rem set = "HR_FORMAT", "
   303     out->print_cr("    Region with largest rem set = " HR_FORMAT ", "
   304                   "size = "SIZE_FORMAT "K, occupied = "SIZE_FORMAT"K.",
   304                   "size = " SIZE_FORMAT "K, occupied = " SIZE_FORMAT "K.",
   305                   HR_FORMAT_PARAMS(max_rs_mem_sz_region()),
   305                   HR_FORMAT_PARAMS(max_rs_mem_sz_region()),
   306                   round_to_K(rem_set->mem_size()),
   306                   round_to_K(rem_set->mem_size()),
   307                   round_to_K(rem_set->occupied()));
   307                   round_to_K(rem_set->occupied()));
   308 
   308 
   309     // Strong code root statistics
   309     // Strong code root statistics
   310     HeapRegionRemSet* max_code_root_rem_set = max_code_root_mem_sz_region()->rem_set();
   310     HeapRegionRemSet* max_code_root_rem_set = max_code_root_mem_sz_region()->rem_set();
   311     out->print_cr("  Total heap region code root sets sizes = "SIZE_FORMAT"K."
   311     out->print_cr("  Total heap region code root sets sizes = " SIZE_FORMAT "K."
   312                   "  Max = "SIZE_FORMAT"K.",
   312                   "  Max = " SIZE_FORMAT "K.",
   313                   round_to_K(total_code_root_mem_sz()),
   313                   round_to_K(total_code_root_mem_sz()),
   314                   round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()));
   314                   round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()));
   315     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   315     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   316       (*current)->print_code_root_mem_info_on(out, total_code_root_mem_sz());
   316       (*current)->print_code_root_mem_info_on(out, total_code_root_mem_sz());
   317     }
   317     }
   318 
   318 
   319     out->print_cr("    "SIZE_FORMAT" code roots represented.",
   319     out->print_cr("    " SIZE_FORMAT " code roots represented.",
   320                   total_code_root_elems());
   320                   total_code_root_elems());
   321     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   321     for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
   322       (*current)->print_code_root_elems_info_on(out, total_code_root_elems());
   322       (*current)->print_code_root_elems_info_on(out, total_code_root_elems());
   323     }
   323     }
   324 
   324 
   325     out->print_cr("    Region with largest amount of code roots = "HR_FORMAT", "
   325     out->print_cr("    Region with largest amount of code roots = " HR_FORMAT ", "
   326                   "size = "SIZE_FORMAT "K, num_elems = "SIZE_FORMAT".",
   326                   "size = " SIZE_FORMAT "K, num_elems = " SIZE_FORMAT ".",
   327                   HR_FORMAT_PARAMS(max_code_root_mem_sz_region()),
   327                   HR_FORMAT_PARAMS(max_code_root_mem_sz_region()),
   328                   round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()),
   328                   round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()),
   329                   round_to_K(max_code_root_rem_set->strong_code_roots_list_length()));
   329                   round_to_K(max_code_root_rem_set->strong_code_roots_list_length()));
   330   }
   330   }
   331 };
   331 };
   332 
   332 
   333 void G1RemSetSummary::print_on(outputStream* out) {
   333 void G1RemSetSummary::print_on(outputStream* out) {
   334   out->print_cr("\n Recent concurrent refinement statistics");
   334   out->print_cr("\n Recent concurrent refinement statistics");
   335   out->print_cr("  Processed "SIZE_FORMAT" cards",
   335   out->print_cr("  Processed " SIZE_FORMAT " cards",
   336                 num_concurrent_refined_cards());
   336                 num_concurrent_refined_cards());
   337   out->print_cr("  Of "SIZE_FORMAT" completed buffers:", num_processed_buf_total());
   337   out->print_cr("  Of " SIZE_FORMAT " completed buffers:", num_processed_buf_total());
   338   out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) by concurrent RS threads.",
   338   out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) by concurrent RS threads.",
   339                 num_processed_buf_total(),
   339                 num_processed_buf_total(),
   340                 percent_of(num_processed_buf_rs_threads(), num_processed_buf_total()));
   340                 percent_of(num_processed_buf_rs_threads(), num_processed_buf_total()));
   341   out->print_cr("     "SIZE_FORMAT_W(8)" (%5.1f%%) by mutator threads.",
   341   out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) by mutator threads.",
   342                 num_processed_buf_mutator(),
   342                 num_processed_buf_mutator(),
   343                 percent_of(num_processed_buf_mutator(), num_processed_buf_total()));
   343                 percent_of(num_processed_buf_mutator(), num_processed_buf_total()));
   344   out->print_cr("  Did "SIZE_FORMAT" coarsenings.", num_coarsenings());
   344   out->print_cr("  Did " SIZE_FORMAT " coarsenings.", num_coarsenings());
   345   out->print_cr("  Concurrent RS threads times (s)");
   345   out->print_cr("  Concurrent RS threads times (s)");
   346   out->print("     ");
   346   out->print("     ");
   347   for (uint i = 0; i < _num_vtimes; i++) {
   347   for (uint i = 0; i < _num_vtimes; i++) {
   348     out->print("    %5.2f", rs_thread_vtime(i));
   348     out->print("    %5.2f", rs_thread_vtime(i));
   349   }
   349   }