72 _target_occupancy,
73 G1CollectedHeap::heap()->used(),
74 _last_allocated_bytes,
75 _last_allocation_time_s,
76 last_marking_length_s());
77 }
78
79 G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent) :
80 G1IHOPControl(ihop_percent),
81 _last_marking_length_s(0.0) {
82 }
83
84 G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
85 G1Predictions const* predictor,
86 size_t heap_reserve_percent,
87 size_t heap_waste_percent) :
88 G1IHOPControl(ihop_percent),
89 _heap_reserve_percent(heap_reserve_percent),
90 _heap_waste_percent(heap_waste_percent),
91 _predictor(predictor),
92 _marking_times_s(10, 0.95),
93 _allocation_rate_s(10, 0.95),
94 _last_unrestrained_young_size(0)
95 {
96 }
97
98 size_t G1AdaptiveIHOPControl::actual_target_threshold() const {
99 guarantee(_target_occupancy > 0, "Target occupancy still not updated yet.");
100 // The actual target threshold takes the heap reserve and the expected waste in
101 // free space into account.
102 // _heap_reserve is that part of the total heap capacity that is reserved for
103 // eventual promotion failure.
104 // _heap_waste is the amount of space will never be reclaimed in any
105 // heap, so can not be used for allocation during marking and must always be
106 // considered.
107
108 double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0);
109
110 return (size_t)MIN2(
111 G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0,
112 _target_occupancy * (100.0 - _heap_waste_percent) / 100.0
113 );
|
72 _target_occupancy,
73 G1CollectedHeap::heap()->used(),
74 _last_allocated_bytes,
75 _last_allocation_time_s,
76 last_marking_length_s());
77 }
78
79 G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent) :
80 G1IHOPControl(ihop_percent),
81 _last_marking_length_s(0.0) {
82 }
83
84 G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
85 G1Predictions const* predictor,
86 size_t heap_reserve_percent,
87 size_t heap_waste_percent) :
88 G1IHOPControl(ihop_percent),
89 _heap_reserve_percent(heap_reserve_percent),
90 _heap_waste_percent(heap_waste_percent),
91 _predictor(predictor),
92 _marking_times_s(10),
93 _allocation_rate_s(10),
94 _last_unrestrained_young_size(0)
95 {
96 }
97
98 size_t G1AdaptiveIHOPControl::actual_target_threshold() const {
99 guarantee(_target_occupancy > 0, "Target occupancy still not updated yet.");
100 // The actual target threshold takes the heap reserve and the expected waste in
101 // free space into account.
102 // _heap_reserve is that part of the total heap capacity that is reserved for
103 // eventual promotion failure.
104 // _heap_waste is the amount of space will never be reclaimed in any
105 // heap, so can not be used for allocation during marking and must always be
106 // considered.
107
108 double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0);
109
110 return (size_t)MIN2(
111 G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0,
112 _target_occupancy * (100.0 - _heap_waste_percent) / 100.0
113 );
|