46 double _prev_collection_pause_end_ms; |
46 double _prev_collection_pause_end_ms; |
47 |
47 |
48 TruncatedSeq* _rs_length_diff_seq; |
48 TruncatedSeq* _rs_length_diff_seq; |
49 TruncatedSeq* _concurrent_refine_rate_ms_seq; |
49 TruncatedSeq* _concurrent_refine_rate_ms_seq; |
50 TruncatedSeq* _logged_cards_rate_ms_seq; |
50 TruncatedSeq* _logged_cards_rate_ms_seq; |
51 TruncatedSeq* _cost_per_logged_card_ms_seq; |
51 // The ratio between the number of merged cards and actually scanned cards, for |
52 TruncatedSeq* _cost_scan_hcc_seq; |
52 // young-only and mixed gcs. |
53 TruncatedSeq* _young_cards_per_entry_ratio_seq; |
53 TruncatedSeq* _young_card_merge_to_scan_ratio_seq; |
54 TruncatedSeq* _mixed_cards_per_entry_ratio_seq; |
54 TruncatedSeq* _mixed_card_merge_to_scan_ratio_seq; |
55 TruncatedSeq* _young_only_cost_per_remset_card_ms_seq; |
55 |
56 TruncatedSeq* _mixed_cost_per_remset_card_ms_seq; |
56 // The cost to scan a card during young-only and mixed gcs in ms. |
57 TruncatedSeq* _cost_per_byte_ms_seq; |
57 TruncatedSeq* _young_cost_per_card_scan_ms_seq; |
|
58 TruncatedSeq* _mixed_cost_per_card_scan_ms_seq; |
|
59 |
|
60 // The cost to merge a card during young-only and mixed gcs in ms. |
|
61 TruncatedSeq* _young_cost_per_card_merge_ms_seq; |
|
62 TruncatedSeq* _mixed_cost_per_card_merge_ms_seq; |
|
63 |
|
64 // The cost to copy a byte in ms. |
|
65 TruncatedSeq* _copy_cost_per_byte_ms_seq; |
58 TruncatedSeq* _constant_other_time_ms_seq; |
66 TruncatedSeq* _constant_other_time_ms_seq; |
59 TruncatedSeq* _young_other_cost_per_region_ms_seq; |
67 TruncatedSeq* _young_other_cost_per_region_ms_seq; |
60 TruncatedSeq* _non_young_other_cost_per_region_ms_seq; |
68 TruncatedSeq* _non_young_other_cost_per_region_ms_seq; |
61 |
69 |
62 TruncatedSeq* _pending_cards_seq; |
70 TruncatedSeq* _pending_cards_seq; |
69 |
77 |
70 // The ratio of gc time to elapsed time, computed over recent pauses, |
78 // The ratio of gc time to elapsed time, computed over recent pauses, |
71 // and the ratio for just the last pause. |
79 // and the ratio for just the last pause. |
72 double _recent_avg_pause_time_ratio; |
80 double _recent_avg_pause_time_ratio; |
73 double _last_pause_time_ratio; |
81 double _last_pause_time_ratio; |
|
82 |
|
83 // Returns whether the sequence have enough samples to get a "good" prediction. |
|
84 // The constant used is random but "small". |
|
85 bool enough_samples_available(TruncatedSeq const* seq) const; |
74 |
86 |
75 double get_new_prediction(TruncatedSeq const* seq) const; |
87 double get_new_prediction(TruncatedSeq const* seq) const; |
76 size_t get_new_size_prediction(TruncatedSeq const* seq) const; |
88 size_t get_new_size_prediction(TruncatedSeq const* seq) const; |
77 |
89 |
78 public: |
90 public: |
101 void report_concurrent_mark_remark_times_ms(double ms); |
113 void report_concurrent_mark_remark_times_ms(double ms); |
102 void report_concurrent_mark_cleanup_times_ms(double ms); |
114 void report_concurrent_mark_cleanup_times_ms(double ms); |
103 void report_alloc_rate_ms(double alloc_rate); |
115 void report_alloc_rate_ms(double alloc_rate); |
104 void report_concurrent_refine_rate_ms(double cards_per_ms); |
116 void report_concurrent_refine_rate_ms(double cards_per_ms); |
105 void report_logged_cards_rate_ms(double cards_per_ms); |
117 void report_logged_cards_rate_ms(double cards_per_ms); |
106 void report_cost_per_logged_card_ms(double cost_per_logged_card_ms); |
118 void report_cost_per_card_scan_ms(double cost_per_remset_card_ms, bool for_young_gc); |
107 void report_cost_scan_hcc(double cost_scan_hcc); |
119 void report_cost_per_card_merge_ms(double cost_per_card_ms, bool for_young_gc); |
108 void report_cost_per_remset_card_ms(double cost_per_remset_card_ms, bool for_young_gc); |
120 void report_card_merge_to_scan_ratio(double cards_per_entry_ratio, bool for_young_gc); |
109 void report_cards_per_entry_ratio(double cards_per_entry_ratio, bool for_young_gc); |
|
110 void report_rs_length_diff(double rs_length_diff); |
121 void report_rs_length_diff(double rs_length_diff); |
111 void report_cost_per_byte_ms(double cost_per_byte_ms, bool mark_or_rebuild_in_progress); |
122 void report_cost_per_byte_ms(double cost_per_byte_ms, bool mark_or_rebuild_in_progress); |
112 void report_young_other_cost_per_region_ms(double other_cost_per_region_ms); |
123 void report_young_other_cost_per_region_ms(double other_cost_per_region_ms); |
113 void report_non_young_other_cost_per_region_ms(double other_cost_per_region_ms); |
124 void report_non_young_other_cost_per_region_ms(double other_cost_per_region_ms); |
114 void report_constant_other_time_ms(double constant_other_time_ms); |
125 void report_constant_other_time_ms(double constant_other_time_ms); |
118 double predict_alloc_rate_ms() const; |
129 double predict_alloc_rate_ms() const; |
119 int num_alloc_rate_ms() const; |
130 int num_alloc_rate_ms() const; |
120 |
131 |
121 double predict_concurrent_refine_rate_ms() const; |
132 double predict_concurrent_refine_rate_ms() const; |
122 double predict_logged_cards_rate_ms() const; |
133 double predict_logged_cards_rate_ms() const; |
123 double predict_cost_per_logged_card_ms() const; |
134 double predict_young_card_merge_to_scan_ratio() const; |
124 |
135 |
125 double predict_scan_hcc_ms() const; |
136 double predict_mixed_card_merge_to_scan_ratio() const; |
126 |
137 |
127 double predict_rs_update_time_ms(size_t pending_cards) const; |
138 size_t predict_scan_card_num(size_t rs_length, bool for_young_gc) const; |
128 |
139 |
129 double predict_young_cards_per_entry_ratio() const; |
140 double predict_card_merge_time_ms(size_t card_num, bool for_young_gc) const; |
130 |
141 double predict_card_scan_time_ms(size_t card_num, bool for_young_gc) const; |
131 double predict_mixed_cards_per_entry_ratio() const; |
|
132 |
|
133 size_t predict_card_num(size_t rs_length, bool for_young_gc) const; |
|
134 |
|
135 double predict_rs_scan_time_ms(size_t card_num, bool for_young_gc) const; |
|
136 |
|
137 double predict_mixed_rs_scan_time_ms(size_t card_num) const; |
|
138 |
142 |
139 double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) const; |
143 double predict_object_copy_time_ms_during_cm(size_t bytes_to_copy) const; |
140 |
144 |
141 double predict_object_copy_time_ms(size_t bytes_to_copy, bool during_concurrent_mark) const; |
145 double predict_object_copy_time_ms(size_t bytes_to_copy, bool during_concurrent_mark) const; |
142 |
146 |
151 double predict_cleanup_time_ms() const; |
155 double predict_cleanup_time_ms() const; |
152 |
156 |
153 size_t predict_rs_length() const; |
157 size_t predict_rs_length() const; |
154 size_t predict_pending_cards() const; |
158 size_t predict_pending_cards() const; |
155 |
159 |
156 double predict_cost_per_byte_ms() const; |
|
157 |
|
158 // Add a new GC of the given duration and end time to the record. |
160 // Add a new GC of the given duration and end time to the record. |
159 void update_recent_gc_times(double end_time_sec, double elapsed_ms); |
161 void update_recent_gc_times(double end_time_sec, double elapsed_ms); |
160 void compute_pause_time_ratio(double interval_ms, double pause_time_ms); |
162 void compute_pause_time_ratio(double interval_ms, double pause_time_ms); |
161 |
163 |
162 double last_known_gc_end_time_sec() const; |
164 double last_known_gc_end_time_sec() const; |