@@ -1010,17 +1010,24 @@ void G1Policy::record_young_gc_pause_end(bool evacuation_failed) {
1010
1010
1011
1011
double G1Policy::predict_base_time_ms (size_t pending_cards,
1012
1012
size_t rs_length) const {
1013
- size_t effective_scanned_cards = _analytics-> predict_scan_card_num (rs_length, collector_state ()->in_young_only_phase () );
1013
+ bool in_young_only_phase = collector_state ()->in_young_only_phase ();
1014
1014
1015
- double card_merge_time = _analytics->predict_card_merge_time_ms (pending_cards + rs_length, collector_state ()->in_young_only_phase ());
1016
- double card_scan_time = _analytics->predict_card_scan_time_ms (effective_scanned_cards, collector_state ()->in_young_only_phase ());
1015
+ size_t unique_cards_from_rs = _analytics->predict_scan_card_num (rs_length, in_young_only_phase);
1016
+ // Assume that all cards from the log buffers will be scanned, i.e. there are no
1017
+ // duplicates in that set.
1018
+ size_t effective_scanned_cards = unique_cards_from_rs + pending_cards;
1019
+
1020
+ double card_merge_time = _analytics->predict_card_merge_time_ms (pending_cards + rs_length, in_young_only_phase);
1021
+ double card_scan_time = _analytics->predict_card_scan_time_ms (effective_scanned_cards, in_young_only_phase);
1017
1022
double constant_other_time = _analytics->predict_constant_other_time_ms ();
1018
1023
double survivor_evac_time = predict_survivor_regions_evac_time ();
1019
1024
1020
1025
double total_time = card_merge_time + card_scan_time + constant_other_time + survivor_evac_time;
1021
1026
1022
- log_trace (gc, ergo, heap)(" Predicted base time: total %f lb_cards %zu rs_length %zu effective_scanned_cards %zu card_merge_time %f card_scan_time %f constant_other_time %f survivor_evac_time %f" ,
1023
- total_time, pending_cards, rs_length, effective_scanned_cards, card_merge_time, card_scan_time, constant_other_time, survivor_evac_time);
1027
+ log_trace (gc, ergo, heap)(" Predicted base time: total %f lb_cards %zu rs_length %zu effective_scanned_cards %zu "
1028
+ " card_merge_time %f card_scan_time %f constant_other_time %f survivor_evac_time %f" ,
1029
+ total_time, pending_cards, rs_length, effective_scanned_cards,
1030
+ card_merge_time, card_scan_time, constant_other_time, survivor_evac_time);
1024
1031
return total_time;
1025
1032
}
1026
1033
0 commit comments