--- old/src/share/vm/gc/g1/g1CollectorPolicy.cpp 2015-10-28 21:17:04.129911806 +0100 +++ new/src/share/vm/gc/g1/g1CollectorPolicy.cpp 2015-10-28 21:17:04.033908980 +0100 @@ -968,11 +968,8 @@ 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); + } else { + maybe_start_marking(); } _mmu_tracker->add_pause(end_time_sec - pause_time_ms/1000.0, end_time_sec); @@ -1057,6 +1054,8 @@ if (!next_gc_should_be_mixed("continue mixed GCs", "do not continue mixed GCs")) { collector_state()->set_gcs_are_young(true); + + maybe_start_marking(); } } @@ -1934,6 +1933,15 @@ 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;