Skip to content

Commit d4d1fbc

Browse files
author
Thomas Schatzl
committed
8282484: G1: Predicted old time in log always zero
Reviewed-by: ayang, iwalulya
1 parent b1f935c commit d4d1fbc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/hotspot/share/gc/g1/g1Policy.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
13131313
num_optional_regions = 0;
13141314
uint num_expensive_regions = 0;
13151315

1316-
double predicted_old_time_ms = 0.0;
13171316
double predicted_initial_time_ms = 0.0;
13181317
double predicted_optional_time_ms = 0.0;
13191318

@@ -1344,7 +1343,7 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
13441343
time_remaining_ms = MAX2(time_remaining_ms - predicted_time_ms, 0.0);
13451344
// Add regions to old set until we reach the minimum amount
13461345
if (num_initial_regions < min_old_cset_length) {
1347-
predicted_old_time_ms += predicted_time_ms;
1346+
predicted_initial_time_ms += predicted_time_ms;
13481347
num_initial_regions++;
13491348
// Record the number of regions added with no time remaining
13501349
if (time_remaining_ms == 0.0) {
@@ -1358,7 +1357,7 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
13581357
} else {
13591358
// Keep adding regions to old set until we reach the optional threshold
13601359
if (time_remaining_ms > optional_threshold_ms) {
1361-
predicted_old_time_ms += predicted_time_ms;
1360+
predicted_initial_time_ms += predicted_time_ms;
13621361
num_initial_regions++;
13631362
} else if (time_remaining_ms > 0) {
13641363
// Keep adding optional regions until time is up.
@@ -1382,7 +1381,7 @@ void G1Policy::calculate_old_collection_set_regions(G1CollectionSetCandidates* c
13821381
}
13831382

13841383
log_debug(gc, ergo, cset)("Finish choosing collection set old regions. Initial: %u, optional: %u, "
1385-
"predicted old time: %1.2fms, predicted optional time: %1.2fms, time remaining: %1.2f",
1384+
"predicted initial time: %1.2fms, predicted optional time: %1.2fms, time remaining: %1.2f",
13861385
num_initial_regions, num_optional_regions,
13871386
predicted_initial_time_ms, predicted_optional_time_ms, time_remaining_ms);
13881387
}

0 commit comments

Comments
 (0)