< prev index next >

src/share/vm/gc/g1/g1IHOPControl.cpp

Print this page
rev 9282 : dihop-changes
rev 9283 : imported patch sihop-thomas-review
rev 9284 : imported patch 8136678-implement-adaptive-sizing-algorithm-for-IHOP
rev 9285 : imported patch aihop-thomas-review
rev 9286 : imported patch 8136679-jfr-event-for-dynamic-ihop

@@ -25,10 +25,11 @@
 #include "precompiled.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1ErgoVerbose.hpp"
 #include "gc/g1/g1IHOPControl.hpp"
 #include "gc/g1/g1Predictions.hpp"
+#include "gc/shared/gcTrace.hpp"
 
 G1IHOPControl::G1IHOPControl(double initial_ihop_percent, size_t target_occupancy) :
   _ihop_percent(initial_ihop_percent),
   _target_occupancy(target_occupancy) {
   assert(_ihop_percent >= 0.0 && _ihop_percent <= 100.0, "Initial IHOP value must be between 0 and 100 but is %.3f", initial_ihop_percent);

@@ -57,10 +58,19 @@
                 G1CollectedHeap::heap()->used(),
                 _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0,
                 _last_marking_length_s * 1000.0);
 }
 
+void G1StaticIHOPControl::send_jfr_event(G1NewTracer* tracer) {
+  tracer->report_basic_ihop_statistics(get_conc_mark_start_threshold(),
+                                       _target_occupancy,
+                                       G1CollectedHeap::heap()->used(),
+                                       _last_allocated_bytes,
+                                       _last_allocation_time_s,
+                                       _last_marking_length_s);
+}
+
 #ifndef PRODUCT
 static void test_update(G1IHOPControl* ctrl, double alloc_time, size_t alloc_amount, size_t young_size, double mark_time) {
   for (int i = 0; i < 100; i++) {
     ctrl->update_allocation_info(alloc_time, alloc_amount, young_size);
     ctrl->update_time_to_mixed(mark_time);

@@ -182,10 +192,23 @@
                 _predictor->get_new_prediction(&_marking_times_s),
                 have_enough_data_for_prediction() ? "true" : "false"
                 );
 }
 
+void G1AdaptiveIHOPControl::send_jfr_event(G1NewTracer* tracer) {
+  tracer->report_basic_ihop_statistics(get_conc_mark_start_threshold(),
+                                       _target_occupancy,
+                                       G1CollectedHeap::heap()->used(),
+                                       _last_allocation_bytes,
+                                       _allocation_rate_s.last(),
+                                       _marking_times_s.last());
+  tracer->report_adaptive_ihop_statistics(_prev_unrestrained_young_size,
+                                          _predictor->get_new_prediction(&_allocation_rate_s),
+                                          _predictor->get_new_prediction(&_marking_times_s),
+                                          have_enough_data_for_prediction());
+}
+
 #ifndef PRODUCT
 void G1AdaptiveIHOPControl::test() {
   size_t const initial_threshold = 45;
   size_t const young_size = 10;
   size_t const target_size = 100;
< prev index next >