< prev index next >

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

Print this page
rev 9216 : imported patch 8138740-start-initial-mark-right-after-mixed-gc-if-needed

*** 966,980 **** #endif // PRODUCT last_pause_included_initial_mark = collector_state()->during_initial_mark_pause(); if (last_pause_included_initial_mark) { record_concurrent_mark_init_end(0.0); ! } else if (need_to_start_conc_mark("end of GC")) { ! // Note: this might have already been set, if during the last ! // pause we decided to start a cycle but at the beginning of ! // this pause we decided to postpone it. That's OK. ! collector_state()->set_initiate_conc_mark_if_possible(true); } _mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0, end_time_sec); if (update_stats) { --- 966,977 ---- #endif // PRODUCT last_pause_included_initial_mark = collector_state()->during_initial_mark_pause(); if (last_pause_included_initial_mark) { record_concurrent_mark_init_end(0.0); ! } else { ! maybe_start_marking(); } _mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0, end_time_sec); if (update_stats) {
*** 1055,1064 **** --- 1052,1063 ---- // mixed GCs or not. if (!next_gc_should_be_mixed("continue mixed GCs", "do not continue mixed GCs")) { collector_state()->set_gcs_are_young(true); + + maybe_start_marking(); } } _short_lived_surv_rate_group->start_adding_regions(); // Do that for any other surv rate groups
*** 1932,1941 **** --- 1931,1949 ---- // percentage of the current heap capacity. size_t capacity_bytes = _g1->capacity(); return (double) reclaimable_bytes * 100.0 / (double) capacity_bytes; } + void G1CollectorPolicy::maybe_start_marking() { + if (need_to_start_conc_mark("end of GC")) { + // Note: this might have already been set, if during the last + // pause we decided to start a cycle but at the beginning of + // this pause we decided to postpone it. That's OK. + collector_state()->set_initiate_conc_mark_if_possible(true); + } + } + bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, const char* false_action_str) const { CollectionSetChooser* cset_chooser = _collectionSetChooser; if (cset_chooser->is_empty()) { ergo_verbose0(ErgoMixedGCs,
< prev index next >