202 // Here, we might want to also take into account any additional
203 // constraints (i.e., user-defined minimum bound). Currently, we
204 // effectively don't set this bound.
205 return _young_gen_sizer.max_desired_young_length();
206 }
207
208 uint G1Policy::update_young_list_max_and_target_length() {
209 return update_young_list_max_and_target_length(_analytics->predict_rs_lengths());
210 }
211
212 uint G1Policy::update_young_list_max_and_target_length(size_t rs_lengths) {
213 uint unbounded_target_length = update_young_list_target_length(rs_lengths);
214 update_max_gc_locker_expansion();
215 return unbounded_target_length;
216 }
217
218 uint G1Policy::update_young_list_target_length(size_t rs_lengths) {
219 YoungTargetLengths young_lengths = young_list_target_lengths(rs_lengths);
220 _young_list_target_length = young_lengths.first;
221
222 // Resize dram regions set if called after full collection end.
223 if(_g1h->is_hetero_heap() && (Thread::current()->is_VM_thread() || Heap_lock->owned_by_self())) {
224 static_cast <HeapRegionManagerForHeteroHeap*>(_g1h->hrm())->resize_dram_regions(_young_list_target_length, _g1h->workers());
225 }
226 return young_lengths.second;
227 }
228
229 G1Policy::YoungTargetLengths G1Policy::young_list_target_lengths(size_t rs_lengths) const {
230 YoungTargetLengths result;
231
232 // Calculate the absolute and desired min bounds first.
233
234 // This is how many young regions we already have (currently: the survivors).
235 const uint base_min_length = _g1h->survivor_regions_count();
236 uint desired_min_length = calculate_young_list_desired_min_length(base_min_length);
237 // This is the absolute minimum young length. Ensure that we
238 // will at least have one eden region available for allocation.
239 uint absolute_min_length = base_min_length + MAX2(_g1h->eden_regions_count(), (uint)1);
240 // If we shrank the young list target it should not shrink below the current size.
241 desired_min_length = MAX2(desired_min_length, absolute_min_length);
242 // Calculate the absolute and desired max bounds.
243
244 uint desired_max_length = calculate_young_list_desired_max_length();
245
|
202 // Here, we might want to also take into account any additional
203 // constraints (i.e., user-defined minimum bound). Currently, we
204 // effectively don't set this bound.
205 return _young_gen_sizer.max_desired_young_length();
206 }
207
208 uint G1Policy::update_young_list_max_and_target_length() {
209 return update_young_list_max_and_target_length(_analytics->predict_rs_lengths());
210 }
211
212 uint G1Policy::update_young_list_max_and_target_length(size_t rs_lengths) {
213 uint unbounded_target_length = update_young_list_target_length(rs_lengths);
214 update_max_gc_locker_expansion();
215 return unbounded_target_length;
216 }
217
218 uint G1Policy::update_young_list_target_length(size_t rs_lengths) {
219 YoungTargetLengths young_lengths = young_list_target_lengths(rs_lengths);
220 _young_list_target_length = young_lengths.first;
221
222 return young_lengths.second;
223 }
224
225 G1Policy::YoungTargetLengths G1Policy::young_list_target_lengths(size_t rs_lengths) const {
226 YoungTargetLengths result;
227
228 // Calculate the absolute and desired min bounds first.
229
230 // This is how many young regions we already have (currently: the survivors).
231 const uint base_min_length = _g1h->survivor_regions_count();
232 uint desired_min_length = calculate_young_list_desired_min_length(base_min_length);
233 // This is the absolute minimum young length. Ensure that we
234 // will at least have one eden region available for allocation.
235 uint absolute_min_length = base_min_length + MAX2(_g1h->eden_regions_count(), (uint)1);
236 // If we shrank the young list target it should not shrink below the current size.
237 desired_min_length = MAX2(desired_min_length, absolute_min_length);
238 // Calculate the absolute and desired max bounds.
239
240 uint desired_max_length = calculate_young_list_desired_max_length();
241
|