< prev index next >
src/share/vm/gc/g1/g1CollectorPolicy.cpp
Print this page
*** 79,92 ****
1.0, 0.7, 0.7, 0.5, 0.5, 0.42, 0.42, 0.30
};
G1CollectorPolicy::G1CollectorPolicy() :
_predictor(G1ConfidencePercent / 100.0),
- _parallel_gc_threads(ParallelGCThreads),
_recent_gc_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)),
- _stop_world_start(0.0),
_concurrent_mark_remark_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)),
_concurrent_mark_cleanup_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)),
_alloc_rate_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
--- 79,90 ----
*** 127,137 ****
// Incremental CSet attributes
_inc_cset_build_state(Inactive),
_inc_cset_head(NULL),
_inc_cset_tail(NULL),
_inc_cset_bytes_used_before(0),
- _inc_cset_max_finger(NULL),
_inc_cset_recorded_rs_lengths(0),
_inc_cset_recorded_rs_lengths_diffs(0),
_inc_cset_predicted_elapsed_time_ms(0.0),
_inc_cset_predicted_elapsed_time_ms_diffs(0.0),
--- 125,134 ----
*** 170,182 ****
_recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime());
_prev_collection_pause_end_ms = os::elapsedTime() * 1000.0;
clear_ratio_check_data();
! _phase_times = new G1GCPhaseTimes(_parallel_gc_threads);
! int index = MIN2(_parallel_gc_threads - 1, 7);
_rs_length_diff_seq->add(rs_length_diff_defaults[index]);
_cost_per_card_ms_seq->add(cost_per_card_ms_defaults[index]);
_cost_scan_hcc_seq->add(0.0);
_young_cards_per_entry_ratio_seq->add(
--- 167,179 ----
_recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime());
_prev_collection_pause_end_ms = os::elapsedTime() * 1000.0;
clear_ratio_check_data();
! _phase_times = new G1GCPhaseTimes(ParallelGCThreads);
! int index = MIN2(ParallelGCThreads - 1, 7u);
_rs_length_diff_seq->add(rs_length_diff_defaults[index]);
_cost_per_card_ms_seq->add(cost_per_card_ms_defaults[index]);
_cost_scan_hcc_seq->add(0.0);
_young_cards_per_entry_ratio_seq->add(
*** 809,820 ****
// since last pause.
double end_sec = os::elapsedTime();
double full_gc_time_sec = end_sec - _full_collection_start_sec;
double full_gc_time_ms = full_gc_time_sec * 1000.0;
- _trace_old_gen_time_data.record_full_collection(full_gc_time_ms);
-
update_recent_gc_times(end_sec, full_gc_time_ms);
collector_state()->set_full_collection(false);
// "Nuke" the heuristics that control the young/mixed GC
--- 806,815 ----
*** 841,868 ****
_bytes_allocated_in_old_since_last_gc = 0;
record_pause(FullGC, _full_collection_start_sec, end_sec);
}
- void G1CollectorPolicy::record_stop_world_start() {
- _stop_world_start = os::elapsedTime();
- }
-
void G1CollectorPolicy::record_collection_pause_start(double start_time_sec) {
// We only need to do this here as the policy will only be applied
// to the GC we're about to start. so, no point is calculating this
// every time we calculate / recalculate the target young length.
update_survivors_policy();
assert(_g1->used() == _g1->recalculate_used(),
"sanity, used: " SIZE_FORMAT " recalculate_used: " SIZE_FORMAT,
_g1->used(), _g1->recalculate_used());
- double s_w_t_ms = (start_time_sec - _stop_world_start) * 1000.0;
- _trace_young_gen_time_data.record_start_collection(s_w_t_ms);
- _stop_world_start = 0.0;
-
phase_times()->record_cur_collection_start_sec(start_time_sec);
_pending_cards = _g1->pending_card_num();
_collection_set_bytes_used_before = 0;
_bytes_copied_during_gc = 0;
--- 836,855 ----
*** 910,926 ****
abort_time_to_mixed_tracking();
}
collector_state()->set_in_marking_window(false);
}
- void G1CollectorPolicy::record_concurrent_pause() {
- if (_stop_world_start > 0.0) {
- double yield_ms = (os::elapsedTime() - _stop_world_start) * 1000.0;
- _trace_young_gen_time_data.record_yield_time(yield_ms);
- }
- }
-
double G1CollectorPolicy::average_time_ms(G1GCPhaseTimes::GCParPhases phase) const {
return phase_times()->average_time_ms(phase);
}
double G1CollectorPolicy::young_other_time_ms() const {
--- 897,906 ----
*** 1001,1011 ****
// We'll just set it to something (arbitrarily) small.
app_time_ms = 1.0;
}
if (update_stats) {
- _trace_young_gen_time_data.record_end_collection(pause_time_ms, phase_times());
// We maintain the invariant that all objects allocated by mutator
// threads will be allocated out of eden regions. So, we can use
// the eden region number allocated since the previous GC to
// calculate the application's allocate rate. The only exception
// to that is humongous objects that are allocated separately. But
--- 981,990 ----
*** 1591,1605 ****
}
return expand_bytes;
}
- void G1CollectorPolicy::print_tracing_info() const {
- _trace_young_gen_time_data.print();
- _trace_old_gen_time_data.print();
- }
-
void G1CollectorPolicy::print_yg_surv_rate_info() const {
#ifndef PRODUCT
_short_lived_surv_rate_group->print_surv_rate_summary();
// add this call for any other surv rate groups
#endif // PRODUCT
--- 1570,1579 ----
*** 1802,1812 ****
_inc_cset_head = NULL;
_inc_cset_tail = NULL;
_inc_cset_bytes_used_before = 0;
- _inc_cset_max_finger = 0;
_inc_cset_recorded_rs_lengths = 0;
_inc_cset_recorded_rs_lengths_diffs = 0;
_inc_cset_predicted_elapsed_time_ms = 0.0;
_inc_cset_predicted_elapsed_time_ms_diffs = 0.0;
_inc_cset_build_state = Active;
--- 1776,1785 ----
*** 1914,1926 ****
// by the Young List sampling code.
size_t rs_length = hr->rem_set()->occupied();
add_to_incremental_cset_info(hr, rs_length);
- HeapWord* hr_end = hr->end();
- _inc_cset_max_finger = MAX2(_inc_cset_max_finger, hr_end);
-
assert(!hr->in_collection_set(), "invariant");
_g1->register_young_region_with_cset(hr);
assert(hr->next_in_collection_set() == NULL, "invariant");
}
--- 1887,1896 ----
*** 2123,2138 ****
log_trace(gc, ergo, cset)("Start choosing CSet. pending cards: " SIZE_FORMAT " predicted base time: %1.2fms remaining time: %1.2fms target pause time: %1.2fms",
_pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms);
collector_state()->set_last_gc_was_young(collector_state()->gcs_are_young());
- if (collector_state()->last_gc_was_young()) {
- _trace_young_gen_time_data.increment_young_collection_count();
- } else {
- _trace_young_gen_time_data.increment_mixed_collection_count();
- }
-
// The young list is laid with the survivor regions from the previous
// pause are appended to the RHS of the young list, i.e.
// [Newly Young Regions ++ Survivors from last pause].
uint survivor_region_length = young_list->survivor_length();
--- 2093,2102 ----
*** 2268,2396 ****
old_cset_region_length(), predicted_old_time_ms, time_remaining_ms);
double non_young_end_time_sec = os::elapsedTime();
phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0);
}
-
- void TraceYoungGenTimeData::record_start_collection(double time_to_stop_the_world_ms) {
- if(TraceYoungGenTime) {
- _all_stop_world_times_ms.add(time_to_stop_the_world_ms);
- }
- }
-
- void TraceYoungGenTimeData::record_yield_time(double yield_time_ms) {
- if(TraceYoungGenTime) {
- _all_yield_times_ms.add(yield_time_ms);
- }
- }
-
- void TraceYoungGenTimeData::record_end_collection(double pause_time_ms, G1GCPhaseTimes* phase_times) {
- if(TraceYoungGenTime) {
- _total.add(pause_time_ms);
- _other.add(pause_time_ms - phase_times->accounted_time_ms());
- _root_region_scan_wait.add(phase_times->root_region_scan_wait_time_ms());
- _parallel.add(phase_times->cur_collection_par_time_ms());
- _ext_root_scan.add(phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan));
- _satb_filtering.add(phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering));
- _update_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS));
- _scan_rs.add(phase_times->average_time_ms(G1GCPhaseTimes::ScanRS));
- _obj_copy.add(phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy));
- _termination.add(phase_times->average_time_ms(G1GCPhaseTimes::Termination));
-
- double parallel_known_time = phase_times->average_time_ms(G1GCPhaseTimes::ExtRootScan) +
- phase_times->average_time_ms(G1GCPhaseTimes::SATBFiltering) +
- phase_times->average_time_ms(G1GCPhaseTimes::UpdateRS) +
- phase_times->average_time_ms(G1GCPhaseTimes::ScanRS) +
- phase_times->average_time_ms(G1GCPhaseTimes::ObjCopy) +
- phase_times->average_time_ms(G1GCPhaseTimes::Termination);
-
- double parallel_other_time = phase_times->cur_collection_par_time_ms() - parallel_known_time;
- _parallel_other.add(parallel_other_time);
- _clear_ct.add(phase_times->cur_clear_ct_time_ms());
- }
- }
-
- void TraceYoungGenTimeData::increment_young_collection_count() {
- if(TraceYoungGenTime) {
- ++_young_pause_num;
- }
- }
-
- void TraceYoungGenTimeData::increment_mixed_collection_count() {
- if(TraceYoungGenTime) {
- ++_mixed_pause_num;
- }
- }
-
- void TraceYoungGenTimeData::print_summary(const char* str,
- const NumberSeq* seq) const {
- double sum = seq->sum();
- tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)",
- str, sum / 1000.0, seq->avg());
- }
-
- void TraceYoungGenTimeData::print_summary_sd(const char* str,
- const NumberSeq* seq) const {
- print_summary(str, seq);
- tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
- "(num", seq->num(), seq->sd(), seq->maximum());
- }
-
- void TraceYoungGenTimeData::print() const {
- if (!TraceYoungGenTime) {
- return;
- }
-
- tty->print_cr("ALL PAUSES");
- print_summary_sd(" Total", &_total);
- tty->cr();
- tty->cr();
- tty->print_cr(" Young GC Pauses: %8d", _young_pause_num);
- tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num);
- tty->cr();
-
- tty->print_cr("EVACUATION PAUSES");
-
- if (_young_pause_num == 0 && _mixed_pause_num == 0) {
- tty->print_cr("none");
- } else {
- print_summary_sd(" Evacuation Pauses", &_total);
- print_summary(" Root Region Scan Wait", &_root_region_scan_wait);
- print_summary(" Parallel Time", &_parallel);
- print_summary(" Ext Root Scanning", &_ext_root_scan);
- print_summary(" SATB Filtering", &_satb_filtering);
- print_summary(" Update RS", &_update_rs);
- print_summary(" Scan RS", &_scan_rs);
- print_summary(" Object Copy", &_obj_copy);
- print_summary(" Termination", &_termination);
- print_summary(" Parallel Other", &_parallel_other);
- print_summary(" Clear CT", &_clear_ct);
- print_summary(" Other", &_other);
- }
- tty->cr();
-
- tty->print_cr("MISC");
- print_summary_sd(" Stop World", &_all_stop_world_times_ms);
- print_summary_sd(" Yields", &_all_yield_times_ms);
- }
-
- void TraceOldGenTimeData::record_full_collection(double full_gc_time_ms) {
- if (TraceOldGenTime) {
- _all_full_gc_times.add(full_gc_time_ms);
- }
- }
-
- void TraceOldGenTimeData::print() const {
- if (!TraceOldGenTime) {
- return;
- }
-
- if (_all_full_gc_times.num() > 0) {
- tty->print("\n%4d full_gcs: total time = %8.2f s",
- _all_full_gc_times.num(),
- _all_full_gc_times.sum() / 1000.0);
- tty->print_cr(" (avg = %8.2fms).", _all_full_gc_times.avg());
- tty->print_cr(" [std. dev = %8.2f ms, max = %8.2f ms]",
- _all_full_gc_times.sd(),
- _all_full_gc_times.maximum());
- }
- }
--- 2232,2236 ----
< prev index next >