--- old/src/hotspot/share/gc/g1/g1IHOPControl.cpp 2020-02-11 11:34:46.230142512 +0100 +++ new/src/hotspot/share/gc/g1/g1IHOPControl.cpp 2020-02-11 11:34:45.822129969 +0100 @@ -39,8 +39,8 @@ } 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; } @@ -81,6 +81,11 @@ _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, @@ -108,7 +113,7 @@ 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 ); } @@ -154,6 +159,8 @@ _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) {