< prev index next >
src/hotspot/share/gc/g1/g1IHOPControl.cpp
Print this page
rev 57998 : [mq]: softmaxheapsize2
@@ -37,12 +37,12 @@
{
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);
}
void G1IHOPControl::update_target_occupancy(size_t new_target_occupancy) {
- log_debug(gc, ihop)("Target occupancy update: old: " SIZE_FORMAT "B, new: " SIZE_FORMAT "B",
- _target_occupancy, new_target_occupancy);
+ log_debug(gc, ihop)("Target occupancy update: old: " SIZE_FORMAT "B, new: " SIZE_FORMAT "B, soft " SIZE_FORMAT "B",
+ _target_occupancy, new_target_occupancy, G1CollectedHeap::heap()->soft_max_capacity());
_target_occupancy = new_target_occupancy;
}
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);
@@ -79,10 +79,15 @@
G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent) :
G1IHOPControl(ihop_percent),
_last_marking_length_s(0.0) {
}
+size_t G1StaticIHOPControl::get_conc_mark_start_threshold() {
+ guarantee(_target_occupancy > 0, "Target occupancy must have been initialized.");
+ return (size_t) (_initial_ihop_percent * _target_occupancy / 100.0);
+}
+
G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
G1Predictions const* predictor,
size_t heap_reserve_percent,
size_t heap_waste_percent) :
G1IHOPControl(ihop_percent),
@@ -106,11 +111,11 @@
// considered.
double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0);
return (size_t)MIN2(
- G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0,
+ G1CollectedHeap::heap()->soft_max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0,
_target_occupancy * (100.0 - _heap_waste_percent) / 100.0
);
}
double G1AdaptiveIHOPControl::predict(TruncatedSeq const* seq) const {
@@ -152,10 +157,12 @@
double allocation_rate = (double) allocated_bytes / allocation_time_s;
_allocation_rate_s.add(allocation_rate);
_last_unrestrained_young_size = additional_buffer_size;
+
+ log_error(gc)("update alloc info: time %1.2fms bytes " SIZE_FORMAT " additional buffer " SIZE_FORMAT, allocation_time_s * 1000.0, allocated_bytes, additional_buffer_size);
}
void G1AdaptiveIHOPControl::update_marking_length(double marking_length_s) {
assert(marking_length_s >= 0.0, "Marking length must be larger than zero but is %.3f", marking_length_s);
_marking_times_s.add(marking_length_s);
< prev index next >