1215 size_t last_unrestrained_young_length = 0;
1216 update_young_list_max_and_target_length(&last_unrestrained_young_length);
1217 update_rs_lengths_prediction();
1218
1219 double marking_to_mixed_time = -1.0;
1220 if (!collector_state()->last_gc_was_young() && _initial_mark_to_mixed.has_result()) {
1221 marking_to_mixed_time = _initial_mark_to_mixed.last_marking_time();
1222 assert(marking_to_mixed_time > 0.0,
1223 "Initial mark to mixed time must be larger than zero but is %.3f",
1224 marking_to_mixed_time);
1225 }
1226 // Only update IHOP information on regular GCs.
1227 if (update_stats) {
1228 update_ihop_statistics(marking_to_mixed_time,
1229 app_time_ms / 1000.0,
1230 _last_old_allocated_bytes,
1231 last_unrestrained_young_length * HeapRegion::GrainBytes);
1232 }
1233 _last_old_allocated_bytes = 0;
1234
1235 // Note that _mmu_tracker->max_gc_time() returns the time in seconds.
1236 double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
1237
1238 double scan_hcc_time_ms = average_time_ms(G1GCPhaseTimes::ScanHCC);
1239
1240 if (update_rs_time_goal_ms < scan_hcc_time_ms) {
1241 ergo_verbose2(ErgoTiming,
1242 "adjust concurrent refinement thresholds",
1243 ergo_format_reason("Scanning the HCC expected to take longer than Update RS time goal")
1244 ergo_format_ms("Update RS time goal")
1245 ergo_format_ms("Scan HCC time"),
1246 update_rs_time_goal_ms,
1247 scan_hcc_time_ms);
1248
1249 update_rs_time_goal_ms = 0;
1250 } else {
1251 update_rs_time_goal_ms -= scan_hcc_time_ms;
1252 }
1253 adjust_concurrent_refinement(average_time_ms(G1GCPhaseTimes::UpdateRS) - scan_hcc_time_ms,
1254 phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS),
|
1215 size_t last_unrestrained_young_length = 0;
1216 update_young_list_max_and_target_length(&last_unrestrained_young_length);
1217 update_rs_lengths_prediction();
1218
1219 double marking_to_mixed_time = -1.0;
1220 if (!collector_state()->last_gc_was_young() && _initial_mark_to_mixed.has_result()) {
1221 marking_to_mixed_time = _initial_mark_to_mixed.last_marking_time();
1222 assert(marking_to_mixed_time > 0.0,
1223 "Initial mark to mixed time must be larger than zero but is %.3f",
1224 marking_to_mixed_time);
1225 }
1226 // Only update IHOP information on regular GCs.
1227 if (update_stats) {
1228 update_ihop_statistics(marking_to_mixed_time,
1229 app_time_ms / 1000.0,
1230 _last_old_allocated_bytes,
1231 last_unrestrained_young_length * HeapRegion::GrainBytes);
1232 }
1233 _last_old_allocated_bytes = 0;
1234
1235 _ihop_control->send_jfr_event(_g1->gc_tracer_stw());
1236
1237 // Note that _mmu_tracker->max_gc_time() returns the time in seconds.
1238 double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSetUpdatingPauseTimePercent / 100.0;
1239
1240 double scan_hcc_time_ms = average_time_ms(G1GCPhaseTimes::ScanHCC);
1241
1242 if (update_rs_time_goal_ms < scan_hcc_time_ms) {
1243 ergo_verbose2(ErgoTiming,
1244 "adjust concurrent refinement thresholds",
1245 ergo_format_reason("Scanning the HCC expected to take longer than Update RS time goal")
1246 ergo_format_ms("Update RS time goal")
1247 ergo_format_ms("Scan HCC time"),
1248 update_rs_time_goal_ms,
1249 scan_hcc_time_ms);
1250
1251 update_rs_time_goal_ms = 0;
1252 } else {
1253 update_rs_time_goal_ms -= scan_hcc_time_ms;
1254 }
1255 adjust_concurrent_refinement(average_time_ms(G1GCPhaseTimes::UpdateRS) - scan_hcc_time_ms,
1256 phase_times()->sum_thread_work_items(G1GCPhaseTimes::UpdateRS),
|