117
118 // The most recent unrestrained size of the young gen. This is used as an additional
119 // factor in the calculation of the threshold, as the threshold is based on
120 // non-young gen occupancy at the end of GC. For the IHOP threshold, we need to
121 // consider the young gen size during that time too.
122 // Since we cannot know what young gen sizes are used in the future, we will just
123 // use the current one. We expect that this one will be one with a fairly large size,
124 // as there is no marking or mixed gc that could impact its size too much.
125 size_t _last_unrestrained_young_size;
126
127 // Get a new prediction bounded below by zero from the given sequence.
128 double predict(TruncatedSeq const* seq) const;
129
130 bool have_enough_data_for_prediction() const;
131
132 // The "actual" target threshold the algorithm wants to keep during and at the
133 // end of marking. This is typically lower than the requested threshold, as the
134 // algorithm needs to consider restrictions by the environment.
135 size_t actual_target_threshold() const;
136
137 // This is used by Adaptive IHOP to sample the old gen allocation rate.
138 // Different from the regular old gen allocation rate, this method considers the
139 // humongous objects that can be reclaimed early by young GCs. Since we cannot
140 // track the life cycle of individual humongous objects, we assume that such
141 // objects were all newly allocated and not survivors, unless more were
142 // reclaimed than allocated.
143 double last_mutator_period_old_allocation_rate() const;
144 protected:
145 virtual double last_marking_length_s() const { return _marking_times_s.last(); }
146 public:
147 G1AdaptiveIHOPControl(double ihop_percent,
148 G1OldGenAllocationTracker const* old_gen_alloc_tracker,
149 G1Predictions const* predictor,
150 size_t heap_reserve_percent, // The percentage of total heap capacity that should not be tapped into.
151 size_t heap_waste_percent); // The percentage of the free space in the heap that we think is not usable for allocation.
152
153 virtual size_t get_conc_mark_start_threshold();
154
155 virtual void update_allocation_info(double allocation_time_s, size_t additional_buffer_size);
156 virtual void update_marking_length(double marking_length_s);
157
158 virtual void print();
159 virtual void send_trace_event(G1NewTracer* tracer);
160 };
161
162 #endif // SHARE_GC_G1_G1IHOPCONTROL_HPP
|
117
118 // The most recent unrestrained size of the young gen. This is used as an additional
119 // factor in the calculation of the threshold, as the threshold is based on
120 // non-young gen occupancy at the end of GC. For the IHOP threshold, we need to
121 // consider the young gen size during that time too.
122 // Since we cannot know what young gen sizes are used in the future, we will just
123 // use the current one. We expect that this one will be one with a fairly large size,
124 // as there is no marking or mixed gc that could impact its size too much.
125 size_t _last_unrestrained_young_size;
126
127 // Get a new prediction bounded below by zero from the given sequence.
128 double predict(TruncatedSeq const* seq) const;
129
130 bool have_enough_data_for_prediction() const;
131
132 // The "actual" target threshold the algorithm wants to keep during and at the
133 // end of marking. This is typically lower than the requested threshold, as the
134 // algorithm needs to consider restrictions by the environment.
135 size_t actual_target_threshold() const;
136
137 // This method calculates the old gen allocation rate based on the net survived
138 // bytes that are allocated in the old generation in the last mutator period.
139 double last_mutator_period_old_allocation_rate() const;
140 protected:
141 virtual double last_marking_length_s() const { return _marking_times_s.last(); }
142 public:
143 G1AdaptiveIHOPControl(double ihop_percent,
144 G1OldGenAllocationTracker const* old_gen_alloc_tracker,
145 G1Predictions const* predictor,
146 size_t heap_reserve_percent, // The percentage of total heap capacity that should not be tapped into.
147 size_t heap_waste_percent); // The percentage of the free space in the heap that we think is not usable for allocation.
148
149 virtual size_t get_conc_mark_start_threshold();
150
151 virtual void update_allocation_info(double allocation_time_s, size_t additional_buffer_size);
152 virtual void update_marking_length(double marking_length_s);
153
154 virtual void print();
155 virtual void send_trace_event(G1NewTracer* tracer);
156 };
157
158 #endif // SHARE_GC_G1_G1IHOPCONTROL_HPP
|