8318713: G1: Use more accurate age in predict_eden_copy_time_ms

Reviewed-by: tschatzl, iwalulya
This commit is contained in:
Albert Mingkun Yang 2023-10-25 08:43:54 +00:00
parent c3cdfe2a32
commit d2d1592dd9

View File

@ -1099,7 +1099,7 @@ double G1Policy::predict_eden_copy_time_ms(uint count, size_t* bytes_to_copy) co
if (count == 0) {
return 0.0;
}
size_t const expected_bytes = _eden_surv_rate_group->accum_surv_rate_pred(count) * HeapRegion::GrainBytes;
size_t const expected_bytes = _eden_surv_rate_group->accum_surv_rate_pred(count - 1) * HeapRegion::GrainBytes;
if (bytes_to_copy != nullptr) {
*bytes_to_copy = expected_bytes;
}