changeset 59265:58278f623d0b

8244714: G1 young gen sizer allows zero young gen with huge -XX:NewRatio Reviewed-by: sjohanss
author tschatzl
date Wed, 13 May 2020 12:47:07 +0200
parents 7af05fae58cd
children 201b6e144007
files src/hotspot/share/gc/g1/g1YoungGenSizer.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp	Wed May 13 10:35:08 2020 +0200
+++ b/src/hotspot/share/gc/g1/g1YoungGenSizer.cpp	Wed May 13 12:47:07 2020 +0200
@@ -102,7 +102,7 @@
       // Do nothing. Values set on the command line, don't update them at runtime.
       break;
     case SizerNewRatio:
-      *min_young_length = number_of_heap_regions / (NewRatio + 1);
+      *min_young_length = MAX2((uint)(number_of_heap_regions / (NewRatio + 1)), 1u);
       *max_young_length = *min_young_length;
       break;
     default: