@@ -1393,13 +1393,13 @@ void G1Policy::calculate_optional_collection_set_regions(G1CollectionSetCandidat
1393
1393
assert (_g1h->collector_state ()->in_mixed_phase (), " Should only be called in mixed phase" );
1394
1394
1395
1395
num_optional_regions = 0 ;
1396
- double prediction_ms = 0 ;
1396
+ double total_prediction_ms = 0. 0 ;
1397
1397
uint candidate_idx = candidates->cur_idx ();
1398
1398
1399
1399
HeapRegion* r = candidates->at (candidate_idx);
1400
1400
while (num_optional_regions < max_optional_regions) {
1401
1401
assert (r != NULL , " Region must exist" );
1402
- prediction_ms + = predict_region_total_time_ms (r, false );
1402
+ double prediction_ms = predict_region_total_time_ms (r, false );
1403
1403
1404
1404
if (prediction_ms > time_remaining_ms) {
1405
1405
log_debug (gc, ergo, cset)(" Prediction %.3fms for region %u does not fit remaining time: %.3fms." ,
@@ -1408,13 +1408,14 @@ void G1Policy::calculate_optional_collection_set_regions(G1CollectionSetCandidat
1408
1408
}
1409
1409
// This region will be included in the next optional evacuation.
1410
1410
1411
+ total_prediction_ms += prediction_ms;
1411
1412
time_remaining_ms -= prediction_ms;
1412
1413
num_optional_regions++;
1413
1414
r = candidates->at (++candidate_idx);
1414
1415
}
1415
1416
1416
- log_debug (gc, ergo, cset)(" Prepared %u regions out of %u for optional evacuation. Predicted time: %.3fms" ,
1417
- num_optional_regions, max_optional_regions, prediction_ms );
1417
+ log_debug (gc, ergo, cset)(" Prepared %u regions out of %u for optional evacuation. Total predicted time: %.3fms" ,
1418
+ num_optional_regions, max_optional_regions, total_prediction_ms );
1418
1419
}
1419
1420
1420
1421
// Number of regions required to store the given number of bytes, taking
1 commit comments
openjdk-notifier[bot] commentedon May 17, 2022
Review
Issues