< prev index next >
src/share/vm/gc/g1/g1IHOPControl.cpp
Print this page
rev 9402 : dihop-changes
rev 9403 : imported patch sihop-thomas-review
rev 9404 : [mq]: erik-jmasa-review
*** 24,39 ****
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ErgoVerbose.hpp"
#include "gc/g1/g1IHOPControl.hpp"
- #include "gc/g1/g1Predictions.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);
}
G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent, size_t target_occupancy) :
G1IHOPControl(ihop_percent, target_occupancy),
_last_allocation_time_s(0.0),
--- 24,38 ----
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#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) {
! 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),
*** 50,71 ****
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(),
! (double) get_conc_mark_start_threshold() / _target_occupancy * 100.0,
_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);
}
#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);
}
}
void G1StaticIHOPControl::test() {
size_t const initial_ihop = 45;
--- 49,70 ----
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,
_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);
}
#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_marking_length(mark_time);
}
}
void G1StaticIHOPControl::test() {
size_t const initial_ihop = 45;
*** 80,90 ****
ctrl.update_allocation_info(100.0, 100, 100);
threshold = ctrl.get_conc_mark_start_threshold();
assert(threshold == initial_ihop,
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
! ctrl.update_time_to_mixed(1000.0);
threshold = ctrl.get_conc_mark_start_threshold();
assert(threshold == initial_ihop,
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
// Whatever we pass, the IHOP value must stay the same.
--- 79,89 ----
ctrl.update_allocation_info(100.0, 100, 100);
threshold = ctrl.get_conc_mark_start_threshold();
assert(threshold == initial_ihop,
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
! ctrl.update_marking_length(1000.0);
threshold = ctrl.get_conc_mark_start_threshold();
assert(threshold == initial_ihop,
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
// Whatever we pass, the IHOP value must stay the same.
< prev index next >