Skip to content
Permalink
Browse files
8276107: Preventive collections trigger before maxing out heap
Reviewed-by: sjohanss, ayang
  • Loading branch information
Thomas Schatzl committed Nov 1, 2021
1 parent c8abe35 commit e265f83858b84451258677f130f98be5375a417a
Showing 1 changed file with 13 additions and 11 deletions.
@@ -1445,17 +1445,19 @@ bool G1Policy::preventive_collection_required(uint alloc_region_count) {
uint required_regions = (uint)(get_num_regions_adjust_for_plab_waste(total_young_predicted_surviving_bytes) +
get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_old));

if (required_regions > _g1h->num_free_regions() - alloc_region_count) {
log_debug(gc, ergo, cset)("Preventive GC, insufficient free regions. Predicted need %u. Curr Eden %u (Pred %u). Curr Survivor %u (Pred %u). Curr Old %u (Pred %u) Free %u Alloc %u",
required_regions,
eden_count,
(uint)get_num_regions_adjust_for_plab_waste(eden_surv_bytes_pred),
_g1h->survivor_regions_count(),
(uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_survivor),
_g1h->old_regions_count(),
(uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_old),
_g1h->num_free_regions(),
alloc_region_count);
if (required_regions > _g1h->num_free_or_available_regions() - alloc_region_count) {
log_debug(gc, ergo, cset)("Preventive GC, insufficient free or available regions. "
"Predicted need %u. Curr Eden %u (Pred %u). Curr Survivor %u (Pred %u). Curr Old %u (Pred %u) Free or Avail %u (Free %u) Alloc %u",
required_regions,
eden_count,
(uint)get_num_regions_adjust_for_plab_waste(eden_surv_bytes_pred),
_g1h->survivor_regions_count(),
(uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_survivor),
_g1h->old_regions_count(),
(uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_old),
_g1h->num_free_or_available_regions(),
_g1h->num_free_regions(),
alloc_region_count);

return true;
}

1 comment on commit e265f83

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on e265f83 Nov 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.