src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp

Print this page
rev 2591 : 6814390: G1: remove the concept of non-generational G1
Summary: Removed the possibility to turn off generational mode for G1.
Reviewed-by: johnc, ysr, tonyp

*** 168,178 **** _all_aux_times_ms(new NumberSeq[_aux_num]), _cur_aux_start_times_ms(new double[_aux_num]), _cur_aux_times_ms(new double[_aux_num]), _cur_aux_times_set(new bool[_aux_num]), - _concurrent_mark_init_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), _concurrent_mark_remark_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), _concurrent_mark_cleanup_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)), // <NEW PREDICTION> --- 168,177 ----
*** 199,209 **** _pause_time_target_ms((double) MaxGCPauseMillis), // </NEW PREDICTION> - _in_young_gc_mode(false), _full_young_gcs(true), _full_young_pause_num(0), _partial_young_pause_num(0), _during_marking(false), --- 198,207 ----
*** 398,408 **** double time_slice = (double) GCPauseIntervalMillis / 1000.0; _mmu_tracker = new G1MMUTrackerQueue(time_slice, max_gc_time); _sigma = (double) G1ConfidencePercent / 100.0; // start conservatively (around 50ms is about right) - _concurrent_mark_init_times_ms->add(0.05); _concurrent_mark_remark_times_ms->add(0.05); _concurrent_mark_cleanup_times_ms->add(0.20); _tenuring_threshold = MaxTenuringThreshold; // if G1FixedSurvivorSpaceSize is 0 which means the size is not --- 396,405 ----
*** 466,478 **** assert(Heap_lock->owned_by_self(), "Locking discipline."); initialize_gc_policy_counters(); - if (G1Gen) { - _in_young_gc_mode = true; - G1YoungGenSizer sizer; size_t initial_region_num = sizer.initial_young_region_num(); if (UseAdaptiveSizePolicy) { set_adaptive_young_list_length(true); --- 463,472 ----
*** 483,506 **** } _free_regions_at_end_of_collection = _g1->free_regions(); calculate_young_list_min_length(); guarantee( _young_list_min_length == 0, "invariant, not enough info" ); calculate_young_list_target_length(); - } else { - _young_list_fixed_length = 0; - _in_young_gc_mode = false; - } // We may immediately start allocating regions and placing them on the // collection set list. Initialize the per-collection set info start_incremental_cset_building(); } // Create the jstat counters for the policy. void G1CollectorPolicy::initialize_gc_policy_counters() { ! _gc_policy_counters = new GCPolicyCounters("GarbageFirst", 1, 2 + G1Gen); } void G1CollectorPolicy::calculate_young_list_min_length() { _young_list_min_length = 0; --- 477,496 ---- } _free_regions_at_end_of_collection = _g1->free_regions(); calculate_young_list_min_length(); guarantee( _young_list_min_length == 0, "invariant, not enough info" ); calculate_young_list_target_length(); // We may immediately start allocating regions and placing them on the // collection set list. Initialize the per-collection set info start_incremental_cset_building(); } // Create the jstat counters for the policy. void G1CollectorPolicy::initialize_gc_policy_counters() { ! _gc_policy_counters = new GCPolicyCounters("GarbageFirst", 1, 3); } void G1CollectorPolicy::calculate_young_list_min_length() { _young_list_min_length = 0;
*** 866,876 **** void G1CollectorPolicy::record_collection_pause_start(double start_time_sec, size_t start_used) { if (PrintGCDetails) { gclog_or_tty->stamp(PrintGCTimeStamps); gclog_or_tty->print("[GC pause"); - if (in_young_gc_mode()) gclog_or_tty->print(" (%s)", full_young_gcs() ? "young" : "partial"); } assert(_g1->used() == _g1->recalculate_used(), err_msg("sanity, used: "SIZE_FORMAT" recalculate_used: "SIZE_FORMAT, --- 856,865 ----
*** 919,929 **** } _satb_drain_time_set = false; _last_satb_drain_processed_buffers = -1; - if (in_young_gc_mode()) _last_young_gc_full = false; // do that for any other surv rate groups _short_lived_surv_rate_group->stop_adding_regions(); _survivors_age_table.clear(); --- 908,917 ----
*** 933,964 **** void G1CollectorPolicy::record_mark_closure_time(double mark_closure_time_ms) { _mark_closure_time_ms = mark_closure_time_ms; } ! void G1CollectorPolicy::record_concurrent_mark_init_start() { ! _mark_init_start_sec = os::elapsedTime(); ! guarantee(!in_young_gc_mode(), "should not do be here in young GC mode"); ! } ! ! void G1CollectorPolicy::record_concurrent_mark_init_end_pre(double mark_init_elapsed_time_ms) { _during_marking = true; assert(!initiate_conc_mark_if_possible(), "we should have cleared it by now"); clear_during_initial_mark_pause(); _cur_mark_stop_world_time_ms = mark_init_elapsed_time_ms; } - void G1CollectorPolicy::record_concurrent_mark_init_end() { - double end_time_sec = os::elapsedTime(); - double elapsed_time_ms = (end_time_sec - _mark_init_start_sec) * 1000.0; - _concurrent_mark_init_times_ms->add(elapsed_time_ms); - record_concurrent_mark_init_end_pre(elapsed_time_ms); - - _mmu_tracker->add_pause(_mark_init_start_sec, end_time_sec, true); - } - void G1CollectorPolicy::record_concurrent_mark_remark_start() { _mark_remark_start_sec = os::elapsedTime(); _during_marking = false; } --- 921,938 ---- void G1CollectorPolicy::record_mark_closure_time(double mark_closure_time_ms) { _mark_closure_time_ms = mark_closure_time_ms; } ! void G1CollectorPolicy::record_concurrent_mark_init_end(double mark_init_elapsed_time_ms) { _during_marking = true; assert(!initiate_conc_mark_if_possible(), "we should have cleared it by now"); clear_during_initial_mark_pause(); _cur_mark_stop_world_time_ms = mark_init_elapsed_time_ms; } void G1CollectorPolicy::record_concurrent_mark_remark_start() { _mark_remark_start_sec = os::elapsedTime(); _during_marking = false; }
*** 1017,1033 **** _n_marks_since_last_pause++; } void G1CollectorPolicy::record_concurrent_mark_cleanup_completed() { - if (in_young_gc_mode()) { _should_revert_to_full_young_gcs = false; _last_full_young_gc = true; _in_marking_window = false; if (adaptive_young_list_length()) calculate_young_list_target_length(); - } } void G1CollectorPolicy::record_concurrent_pause() { if (_stop_world_start > 0.0) { double yield_ms = (os::elapsedTime() - _stop_world_start) * 1000.0; --- 991,1005 ----
*** 1172,1185 **** _short_lived_surv_rate_group->print(); // do that for any other surv rate groups too } #endif // PRODUCT - if (in_young_gc_mode()) { last_pause_included_initial_mark = during_initial_mark_pause(); if (last_pause_included_initial_mark) ! record_concurrent_mark_init_end_pre(0.0); size_t min_used_targ = (_g1->capacity() / 100) * InitiatingHeapOccupancyPercent; --- 1144,1156 ---- _short_lived_surv_rate_group->print(); // do that for any other surv rate groups too } #endif // PRODUCT last_pause_included_initial_mark = during_initial_mark_pause(); if (last_pause_included_initial_mark) ! record_concurrent_mark_init_end(0.0); size_t min_used_targ = (_g1->capacity() / 100) * InitiatingHeapOccupancyPercent;
*** 1195,1205 **** set_initiate_conc_mark_if_possible(); } } _prev_collection_pause_used_at_end_bytes = cur_used_bytes; - } _mmu_tracker->add_pause(end_time_sec - elapsed_ms/1000.0, end_time_sec, false); guarantee(_cur_collection_pause_used_regions_at_start >= --- 1166,1175 ----
*** 1466,1476 **** if (during_initial_mark_pause()) { new_in_marking_window = true; new_in_marking_window_im = true; } - if (in_young_gc_mode()) { if (_last_full_young_gc) { set_full_young_gcs(false); _last_full_young_gc = false; } --- 1436,1445 ----
*** 1482,1492 **** set_full_young_gcs(true); } } _should_revert_to_full_young_gcs = false; ! if (_last_young_gc_full && !_during_marking) _young_gc_eff_seq->add(cur_efficiency); } _short_lived_surv_rate_group->start_adding_regions(); // do that for any other surv rate groupsx --- 1451,1461 ---- set_full_young_gcs(true); } } _should_revert_to_full_young_gcs = false; ! if (_last_young_gc_full && !_during_marking) { _young_gc_eff_seq->add(cur_efficiency); } _short_lived_surv_rate_group->start_adding_regions(); // do that for any other surv rate groupsx
*** 1908,1927 **** void G1CollectorPolicy::check_if_region_is_too_expensive(double predicted_time_ms) { // I don't think we need to do this when in young GC mode since // marking will be initiated next time we hit the soft limit anyway... if (predicted_time_ms > _expensive_region_limit_ms) { - if (!in_young_gc_mode()) { - set_full_young_gcs(true); - // We might want to do something different here. However, - // right now we don't support the non-generational G1 mode - // (and in fact we are planning to remove the associated code, - // see CR 6814390). So, let's leave it as is and this will be - // removed some time in the future - ShouldNotReachHere(); - set_during_initial_mark_pause(); - } else // no point in doing another partial one _should_revert_to_full_young_gcs = true; } } --- 1877,1886 ----
*** 2615,2627 **** _inc_cset_head = NULL; _inc_cset_tail = NULL; _inc_cset_size = 0; _inc_cset_bytes_used_before = 0; - if (in_young_gc_mode()) { _inc_cset_young_index = 0; - } _inc_cset_max_finger = 0; _inc_cset_recorded_young_bytes = 0; _inc_cset_recorded_rs_lengths = 0; _inc_cset_predicted_elapsed_time_ms = 0; --- 2574,2584 ----
*** 2846,2856 **** // Adjust for expansion and slop. max_live_bytes = max_live_bytes + expansion_bytes; HeapRegion* hr; - if (in_young_gc_mode()) { double young_start_time_sec = os::elapsedTime(); if (G1PolicyVerbose > 0) { gclog_or_tty->print_cr("Adding %d young regions to the CSet", _g1->young_list()->length()); --- 2803,2812 ----
*** 2917,2935 **** (young_end_time_sec - young_start_time_sec) * 1000.0; // We are doing young collections so reset this. non_young_start_time_sec = young_end_time_sec; ! // Note we can use either _collection_set_size or ! // _young_cset_length here ! if (_collection_set_size > 0 && _last_young_gc_full) { ! // don't bother adding more regions... ! goto choose_collection_set_end; ! } ! } ! ! if (!in_young_gc_mode() || !full_young_gcs()) { bool should_continue = true; NumberSeq seq; double avg_prediction = 100000000000000000.0; // something very large do { --- 2873,2883 ---- (young_end_time_sec - young_start_time_sec) * 1000.0; // We are doing young collections so reset this. non_young_start_time_sec = young_end_time_sec; ! if (!full_young_gcs()) { bool should_continue = true; NumberSeq seq; double avg_prediction = 100000000000000000.0; // something very large do {
*** 2958,2968 **** if (!adaptive_young_list_length() && _collection_set_size < _young_list_fixed_length) _should_revert_to_full_young_gcs = true; } - choose_collection_set_end: stop_incremental_cset_building(); count_CS_bytes_used(); end_recording_regions(); --- 2906,2915 ----