164 _num_markings(0), |
164 _num_markings(0), |
165 _n_marks(0), |
165 _n_marks(0), |
166 _n_pauses_at_mark_end(0), |
166 _n_pauses_at_mark_end(0), |
167 |
167 |
168 _all_full_gc_times_ms(new NumberSeq()), |
168 _all_full_gc_times_ms(new NumberSeq()), |
169 |
|
170 _conc_refine_enabled(0), |
|
171 _conc_refine_zero_traversals(0), |
|
172 _conc_refine_max_traversals(0), |
|
173 _conc_refine_current_delta(G1ConcRefineInitialDelta), |
|
174 |
169 |
175 // G1PausesBtwnConcMark defaults to -1 |
170 // G1PausesBtwnConcMark defaults to -1 |
176 // so the hack is to do the cast QQQ FIXME |
171 // so the hack is to do the cast QQQ FIXME |
177 _pauses_btwn_concurrent_mark((size_t)G1PausesBtwnConcMark), |
172 _pauses_btwn_concurrent_mark((size_t)G1PausesBtwnConcMark), |
178 _n_marks_since_last_pause(0), |
173 _n_marks_since_last_pause(0), |
1632 } |
1627 } |
1633 if (parallel) { |
1628 if (parallel) { |
1634 print_stats(1, "Parallel Time", _cur_collection_par_time_ms); |
1629 print_stats(1, "Parallel Time", _cur_collection_par_time_ms); |
1635 print_par_stats(2, "Update RS (Start)", _par_last_update_rs_start_times_ms, false); |
1630 print_par_stats(2, "Update RS (Start)", _par_last_update_rs_start_times_ms, false); |
1636 print_par_stats(2, "Update RS", _par_last_update_rs_times_ms); |
1631 print_par_stats(2, "Update RS", _par_last_update_rs_times_ms); |
1637 if (G1RSBarrierUseQueue) |
1632 print_par_buffers(3, "Processed Buffers", |
1638 print_par_buffers(3, "Processed Buffers", |
1633 _par_last_update_rs_processed_buffers, true); |
1639 _par_last_update_rs_processed_buffers, true); |
|
1640 print_par_stats(2, "Ext Root Scanning", _par_last_ext_root_scan_times_ms); |
1634 print_par_stats(2, "Ext Root Scanning", _par_last_ext_root_scan_times_ms); |
1641 print_par_stats(2, "Mark Stack Scanning", _par_last_mark_stack_scan_times_ms); |
1635 print_par_stats(2, "Mark Stack Scanning", _par_last_mark_stack_scan_times_ms); |
1642 print_par_stats(2, "Scan-Only Scanning", _par_last_scan_only_times_ms); |
1636 print_par_stats(2, "Scan-Only Scanning", _par_last_scan_only_times_ms); |
1643 print_par_buffers(3, "Scan-Only Regions", |
1637 print_par_buffers(3, "Scan-Only Regions", |
1644 _par_last_scan_only_regions_scanned, true); |
1638 _par_last_scan_only_regions_scanned, true); |
1647 print_par_stats(2, "Termination", _par_last_termination_times_ms); |
1641 print_par_stats(2, "Termination", _par_last_termination_times_ms); |
1648 print_stats(2, "Other", parallel_other_time); |
1642 print_stats(2, "Other", parallel_other_time); |
1649 print_stats(1, "Clear CT", _cur_clear_ct_time_ms); |
1643 print_stats(1, "Clear CT", _cur_clear_ct_time_ms); |
1650 } else { |
1644 } else { |
1651 print_stats(1, "Update RS", update_rs_time); |
1645 print_stats(1, "Update RS", update_rs_time); |
1652 if (G1RSBarrierUseQueue) |
1646 print_stats(2, "Processed Buffers", |
1653 print_stats(2, "Processed Buffers", |
1647 (int)update_rs_processed_buffers); |
1654 (int)update_rs_processed_buffers); |
|
1655 print_stats(1, "Ext Root Scanning", ext_root_scan_time); |
1648 print_stats(1, "Ext Root Scanning", ext_root_scan_time); |
1656 print_stats(1, "Mark Stack Scanning", mark_stack_scan_time); |
1649 print_stats(1, "Mark Stack Scanning", mark_stack_scan_time); |
1657 print_stats(1, "Scan-Only Scanning", scan_only_time); |
1650 print_stats(1, "Scan-Only Scanning", scan_only_time); |
1658 print_stats(1, "Scan RS", scan_rs_time); |
1651 print_stats(1, "Scan RS", scan_rs_time); |
1659 print_stats(1, "Object Copying", obj_copy_time); |
1652 print_stats(1, "Object Copying", obj_copy_time); |
2465 all_region_num, |
2458 all_region_num, |
2466 _region_num_young, |
2459 _region_num_young, |
2467 (double) _region_num_young / (double) all_region_num * 100.0, |
2460 (double) _region_num_young / (double) all_region_num * 100.0, |
2468 _region_num_tenured, |
2461 _region_num_tenured, |
2469 (double) _region_num_tenured / (double) all_region_num * 100.0); |
2462 (double) _region_num_tenured / (double) all_region_num * 100.0); |
2470 |
|
2471 if (!G1RSBarrierUseQueue) { |
|
2472 gclog_or_tty->print_cr("Of %d times conc refinement was enabled, %d (%7.2f%%) " |
|
2473 "did zero traversals.", |
|
2474 _conc_refine_enabled, _conc_refine_zero_traversals, |
|
2475 _conc_refine_enabled > 0 ? |
|
2476 100.0 * (float)_conc_refine_zero_traversals/ |
|
2477 (float)_conc_refine_enabled : 0.0); |
|
2478 gclog_or_tty->print_cr(" Max # of traversals = %d.", |
|
2479 _conc_refine_max_traversals); |
|
2480 gclog_or_tty->print_cr(""); |
|
2481 } |
|
2482 } |
2463 } |
2483 if (TraceGen1Time) { |
2464 if (TraceGen1Time) { |
2484 if (_all_full_gc_times_ms->num() > 0) { |
2465 if (_all_full_gc_times_ms->num() > 0) { |
2485 gclog_or_tty->print("\n%4d full_gcs: total time = %8.2f s", |
2466 gclog_or_tty->print("\n%4d full_gcs: total time = %8.2f s", |
2486 _all_full_gc_times_ms->num(), |
2467 _all_full_gc_times_ms->num(), |
2496 void G1CollectorPolicy::print_yg_surv_rate_info() const { |
2477 void G1CollectorPolicy::print_yg_surv_rate_info() const { |
2497 #ifndef PRODUCT |
2478 #ifndef PRODUCT |
2498 _short_lived_surv_rate_group->print_surv_rate_summary(); |
2479 _short_lived_surv_rate_group->print_surv_rate_summary(); |
2499 // add this call for any other surv rate groups |
2480 // add this call for any other surv rate groups |
2500 #endif // PRODUCT |
2481 #endif // PRODUCT |
2501 } |
|
2502 |
|
2503 void G1CollectorPolicy::update_conc_refine_data() { |
|
2504 unsigned traversals = _g1->concurrent_g1_refine()->disable(); |
|
2505 if (traversals == 0) _conc_refine_zero_traversals++; |
|
2506 _conc_refine_max_traversals = MAX2(_conc_refine_max_traversals, |
|
2507 (size_t)traversals); |
|
2508 |
|
2509 if (G1PolicyVerbose > 1) |
|
2510 gclog_or_tty->print_cr("Did a CR traversal series: %d traversals.", traversals); |
|
2511 double multiplier = 1.0; |
|
2512 if (traversals == 0) { |
|
2513 multiplier = 4.0; |
|
2514 } else if (traversals > (size_t)G1ConcRefineTargTraversals) { |
|
2515 multiplier = 1.0/1.5; |
|
2516 } else if (traversals < (size_t)G1ConcRefineTargTraversals) { |
|
2517 multiplier = 1.5; |
|
2518 } |
|
2519 if (G1PolicyVerbose > 1) { |
|
2520 gclog_or_tty->print_cr(" Multiplier = %7.2f.", multiplier); |
|
2521 gclog_or_tty->print(" Delta went from %d regions to ", |
|
2522 _conc_refine_current_delta); |
|
2523 } |
|
2524 _conc_refine_current_delta = |
|
2525 MIN2(_g1->n_regions(), |
|
2526 (size_t)(_conc_refine_current_delta * multiplier)); |
|
2527 _conc_refine_current_delta = |
|
2528 MAX2(_conc_refine_current_delta, (size_t)1); |
|
2529 if (G1PolicyVerbose > 1) { |
|
2530 gclog_or_tty->print_cr("%d regions.", _conc_refine_current_delta); |
|
2531 } |
|
2532 _conc_refine_enabled++; |
|
2533 } |
2482 } |
2534 |
2483 |
2535 bool |
2484 bool |
2536 G1CollectorPolicy::should_add_next_region_to_young_list() { |
2485 G1CollectorPolicy::should_add_next_region_to_young_list() { |
2537 assert(in_young_gc_mode(), "should be in young GC mode"); |
2486 assert(in_young_gc_mode(), "should be in young GC mode"); |