@@ -683,8 +683,7 @@ void G1Policy::record_young_collection_end(bool concurrent_operation_is_full_mar
683
683
} else if (G1GCPauseTypeHelper::is_mixed_pause (this_pause)) {
684
684
// This is a mixed GC. Here we decide whether to continue doing more
685
685
// mixed GCs or not.
686
- if (!next_gc_should_be_mixed (" continue mixed GCs" ,
687
- " do not continue mixed GCs" )) {
686
+ if (!next_gc_should_be_mixed (" do not continue mixed GCs" )) {
688
687
collector_state ()->set_in_young_only_phase (true );
689
688
690
689
clear_collection_set_candidates ();
@@ -1125,7 +1124,7 @@ void G1Policy::record_concurrent_mark_cleanup_end(bool has_rebuilt_remembered_se
1125
1124
if (has_rebuilt_remembered_sets) {
1126
1125
G1CollectionSetCandidates* candidates = G1CollectionSetChooser::build (_g1h->workers (), _g1h->num_regions ());
1127
1126
_collection_set->set_candidates (candidates);
1128
- mixed_gc_pending = next_gc_should_be_mixed (" request mixed gcs " , " request young-only gcs" );
1127
+ mixed_gc_pending = next_gc_should_be_mixed (" request young-only gcs" );
1129
1128
}
1130
1129
1131
1130
if (log_is_enabled (Trace, gc, liveness)) {
@@ -1248,16 +1247,16 @@ void G1Policy::abort_time_to_mixed_tracking() {
1248
1247
_concurrent_start_to_mixed.reset ();
1249
1248
}
1250
1249
1251
- bool G1Policy::next_gc_should_be_mixed (const char * true_action_str,
1252
- const char * false_action_str) const {
1250
+ bool G1Policy::next_gc_should_be_mixed (const char * no_candidates_str) const {
1253
1251
G1CollectionSetCandidates* candidates = _collection_set->candidates ();
1254
1252
1255
1253
if (candidates == NULL || candidates->is_empty ()) {
1256
- log_debug (gc, ergo)(" %s (candidate old regions not available)" , false_action_str );
1254
+ log_debug (gc, ergo)(" %s (candidate old regions not available)" , no_candidates_str );
1257
1255
return false ;
1258
1256
}
1259
- // Go through all regions - we already pruned regions not worth collecting
1260
- // during candidate selection.
1257
+ // Otherwise always continue mixed collection. There is no other reason to stop the
1258
+ // mixed phase than there are no more candidates. All candidates not pruned earlier
1259
+ // during candidate selection are worth collecting.
1261
1260
return true ;
1262
1261
}
1263
1262
0 commit comments