43 assert(_target_occupancy > 0, "Target occupancy must be larger than zero.");
44 }
45
46 void G1StaticIHOPControl::print() {
47 ergo_verbose6(ErgoIHOP,
48 "basic information",
49 ergo_format_reason("value update")
50 ergo_format_byte_perc("threshold")
51 ergo_format_byte("target occupancy")
52 ergo_format_byte("current occupancy")
53 ergo_format_double("recent old gen allocation rate")
54 ergo_format_double("recent marking phase length"),
55 get_conc_mark_start_threshold(),
56 (double) get_conc_mark_start_threshold() / _target_occupancy * 100.0,
57 _target_occupancy,
58 G1CollectedHeap::heap()->used(),
59 _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0,
60 _last_marking_length_s);
61 }
62
63 void G1StaticIHOPControl::send_jfr_event(G1NewTracer* tracer) {
64 tracer->report_basic_ihop_statistics(get_conc_mark_start_threshold(),
65 _target_occupancy,
66 G1CollectedHeap::heap()->used(),
67 _last_allocated_bytes,
68 _last_allocation_time_s,
69 _last_marking_length_s);
70 }
71
72 #ifndef PRODUCT
73 static void test_update(G1IHOPControl* ctrl, double alloc_time, size_t alloc_amount, size_t young_size, double mark_time) {
74 for (int i = 0; i < 100; i++) {
75 ctrl->update_allocation_info(alloc_time, alloc_amount, young_size);
76 ctrl->update_time_to_mixed(mark_time);
77 }
78 }
79
80 void G1StaticIHOPControl::test() {
81 size_t const initial_ihop = 45;
82
83 G1StaticIHOPControl ctrl(initial_ihop, 100);
177 ergo_format_double("recent marking phase length"),
178 get_conc_mark_start_threshold(),
179 _target_occupancy > 0 ? (double) get_conc_mark_start_threshold() / _target_occupancy * 100.0 : 0.0,
180 _target_occupancy,
181 G1CollectedHeap::heap()->used(),
182 _allocation_rate_s.last(),
183 _marking_times_s.last()
184 );
185 ergo_verbose3(ErgoIHOP,
186 "adaptive IHOP information",
187 ergo_format_reason("value update")
188 ergo_format_double("predicted old gen allocation rate")
189 ergo_format_double("predicted marking phase length")
190 ergo_format_str("prediction active"),
191 _predictor->get_new_prediction(&_allocation_rate_s),
192 _predictor->get_new_prediction(&_marking_times_s),
193 have_enough_data_for_prediction() ? "true" : "false"
194 );
195 }
196
197 void G1AdaptiveIHOPControl::send_jfr_event(G1NewTracer* tracer) {
198 tracer->report_basic_ihop_statistics(get_conc_mark_start_threshold(),
199 _target_occupancy,
200 G1CollectedHeap::heap()->used(),
201 _last_allocation_bytes,
202 _allocation_rate_s.last(),
203 _marking_times_s.last());
204 tracer->report_adaptive_ihop_statistics(_prev_unrestrained_young_size,
205 _predictor->get_new_prediction(&_allocation_rate_s),
206 _predictor->get_new_prediction(&_marking_times_s),
207 have_enough_data_for_prediction());
208 }
209
210 #ifndef PRODUCT
211 void G1AdaptiveIHOPControl::test() {
212 size_t const initial_threshold = 45;
213 size_t const young_size = 10;
214 size_t const target_size = 100;
215
216 // The final IHOP value is always
217 // target_size - (young_size + alloc_amount/alloc_time * marking_time)
|
43 assert(_target_occupancy > 0, "Target occupancy must be larger than zero.");
44 }
45
46 void G1StaticIHOPControl::print() {
47 ergo_verbose6(ErgoIHOP,
48 "basic information",
49 ergo_format_reason("value update")
50 ergo_format_byte_perc("threshold")
51 ergo_format_byte("target occupancy")
52 ergo_format_byte("current occupancy")
53 ergo_format_double("recent old gen allocation rate")
54 ergo_format_double("recent marking phase length"),
55 get_conc_mark_start_threshold(),
56 (double) get_conc_mark_start_threshold() / _target_occupancy * 100.0,
57 _target_occupancy,
58 G1CollectedHeap::heap()->used(),
59 _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0,
60 _last_marking_length_s);
61 }
62
63 void G1StaticIHOPControl::send_event(G1NewTracer* tracer) {
64 tracer->report_basic_ihop_statistics(get_conc_mark_start_threshold(),
65 _target_occupancy,
66 G1CollectedHeap::heap()->used(),
67 _last_allocated_bytes,
68 _last_allocation_time_s,
69 _last_marking_length_s);
70 }
71
72 #ifndef PRODUCT
73 static void test_update(G1IHOPControl* ctrl, double alloc_time, size_t alloc_amount, size_t young_size, double mark_time) {
74 for (int i = 0; i < 100; i++) {
75 ctrl->update_allocation_info(alloc_time, alloc_amount, young_size);
76 ctrl->update_time_to_mixed(mark_time);
77 }
78 }
79
80 void G1StaticIHOPControl::test() {
81 size_t const initial_ihop = 45;
82
83 G1StaticIHOPControl ctrl(initial_ihop, 100);
177 ergo_format_double("recent marking phase length"),
178 get_conc_mark_start_threshold(),
179 _target_occupancy > 0 ? (double) get_conc_mark_start_threshold() / _target_occupancy * 100.0 : 0.0,
180 _target_occupancy,
181 G1CollectedHeap::heap()->used(),
182 _allocation_rate_s.last(),
183 _marking_times_s.last()
184 );
185 ergo_verbose3(ErgoIHOP,
186 "adaptive IHOP information",
187 ergo_format_reason("value update")
188 ergo_format_double("predicted old gen allocation rate")
189 ergo_format_double("predicted marking phase length")
190 ergo_format_str("prediction active"),
191 _predictor->get_new_prediction(&_allocation_rate_s),
192 _predictor->get_new_prediction(&_marking_times_s),
193 have_enough_data_for_prediction() ? "true" : "false"
194 );
195 }
196
197 void G1AdaptiveIHOPControl::send_event(G1NewTracer* tracer) {
198 tracer->report_basic_ihop_statistics(get_conc_mark_start_threshold(),
199 _target_occupancy,
200 G1CollectedHeap::heap()->used(),
201 _last_allocation_bytes,
202 _allocation_rate_s.last(),
203 _marking_times_s.last());
204 tracer->report_adaptive_ihop_statistics(_prev_unrestrained_young_size,
205 _predictor->get_new_prediction(&_allocation_rate_s),
206 _predictor->get_new_prediction(&_marking_times_s),
207 have_enough_data_for_prediction());
208 }
209
210 #ifndef PRODUCT
211 void G1AdaptiveIHOPControl::test() {
212 size_t const initial_threshold = 45;
213 size_t const young_size = 10;
214 size_t const target_size = 100;
215
216 // The final IHOP value is always
217 // target_size - (young_size + alloc_amount/alloc_time * marking_time)
|