< prev index next >

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

Print this page
rev 9416 : dihop-changes
rev 9417 : imported patch sihop-thomas-review
rev 9418 : imported patch erik-jmasa-review
rev 9419 : [mq]: fix-evac-failure-needs-stats

@@ -27,37 +27,46 @@
 #include "gc/g1/g1ErgoVerbose.hpp"
 #include "gc/g1/g1IHOPControl.hpp"
 
 G1IHOPControl::G1IHOPControl(double initial_ihop_percent, size_t target_occupancy) :
   _initial_ihop_percent(initial_ihop_percent),
-  _target_occupancy(target_occupancy) {
+  _target_occupancy(target_occupancy),
+  _last_allocated_bytes(0),
+  _last_allocation_time_s(0.0)
+{
   assert(_initial_ihop_percent >= 0.0 && _initial_ihop_percent <= 100.0, "Initial IHOP value must be between 0 and 100 but is %.3f", initial_ihop_percent);
 }
 
-G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent, size_t target_occupancy) :
-  G1IHOPControl(ihop_percent, target_occupancy),
-  _last_allocation_time_s(0.0),
-  _last_allocated_bytes(0),
-  _last_marking_length_s(0.0) {
-  assert(_target_occupancy > 0, "Target occupancy must be larger than zero.");
+void G1IHOPControl::update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size) {
+  assert(allocation_time_s >= 0.0, "Allocation time must be positive but is %.3f", allocation_time_s);
+
+  _last_allocation_time_s = allocation_time_s;
+  _last_allocated_bytes = allocated_bytes;
 }
 
-void G1StaticIHOPControl::print() {
+void G1IHOPControl::print() {
+  size_t cur_conc_mark_start_threshold = get_conc_mark_start_threshold();
   ergo_verbose6(ErgoIHOP,
                 "basic information",
                 ergo_format_reason("value update")
                 ergo_format_byte_perc("threshold")
                 ergo_format_byte("target occupancy")
                 ergo_format_byte("current occupancy")
                 ergo_format_double("recent old gen allocation rate")
-                ergo_format_ms("recent marking phase length"),
-                get_conc_mark_start_threshold(),
-                _initial_ihop_percent,
+                ergo_format_double("recent marking phase length"),
+                cur_conc_mark_start_threshold,
+                cur_conc_mark_start_threshold * 100.0 / _target_occupancy,
                 _target_occupancy,
                 G1CollectedHeap::heap()->used(),
                 _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0,
-                _last_marking_length_s * 1000.0);
+                last_marking_length_s());
+}
+
+G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent, size_t target_occupancy) :
+  G1IHOPControl(ihop_percent, target_occupancy),
+  _last_marking_length_s(0.0) {
+  assert(_target_occupancy > 0, "Target occupancy must be larger than zero.");
 }
 
 #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++) {
< prev index next >