Skip to content
Permalink
Browse files

8242075: Shenandoah: rename ShenandoahHeapRegionSize flag

Reviewed-by: rkennke
  • Loading branch information
shipilev committed Apr 3, 2020
1 parent 62b7404 commit cd76575df18a1e7cb778a7d484d361274fbabad1
@@ -521,7 +521,7 @@ void ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
}

size_t region_size;
if (FLAG_IS_DEFAULT(ShenandoahHeapRegionSize)) {
if (FLAG_IS_DEFAULT(ShenandoahRegionSize)) {
if (ShenandoahMinRegionSize > max_heap_size / MIN_NUM_REGIONS) {
err_msg message("Max heap size (" SIZE_FORMAT "%s) is too low to afford the minimum number "
"of regions (" SIZE_FORMAT ") of minimum region size (" SIZE_FORMAT "%s).",
@@ -564,27 +564,27 @@ void ShenandoahHeapRegion::setup_sizes(size_t max_heap_size) {
region_size = MIN2(ShenandoahMaxRegionSize, region_size);

} else {
if (ShenandoahHeapRegionSize > max_heap_size / MIN_NUM_REGIONS) {
if (ShenandoahRegionSize > max_heap_size / MIN_NUM_REGIONS) {
err_msg message("Max heap size (" SIZE_FORMAT "%s) is too low to afford the minimum number "
"of regions (" SIZE_FORMAT ") of requested size (" SIZE_FORMAT "%s).",
byte_size_in_proper_unit(max_heap_size), proper_unit_for_byte_size(max_heap_size),
MIN_NUM_REGIONS,
byte_size_in_proper_unit(ShenandoahHeapRegionSize), proper_unit_for_byte_size(ShenandoahHeapRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahHeapRegionSize option", message);
byte_size_in_proper_unit(ShenandoahRegionSize), proper_unit_for_byte_size(ShenandoahRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahRegionSize option", message);
}
if (ShenandoahHeapRegionSize < ShenandoahMinRegionSize) {
if (ShenandoahRegionSize < ShenandoahMinRegionSize) {
err_msg message("Heap region size (" SIZE_FORMAT "%s) should be larger than min region size (" SIZE_FORMAT "%s).",
byte_size_in_proper_unit(ShenandoahHeapRegionSize), proper_unit_for_byte_size(ShenandoahHeapRegionSize),
byte_size_in_proper_unit(ShenandoahRegionSize), proper_unit_for_byte_size(ShenandoahRegionSize),
byte_size_in_proper_unit(ShenandoahMinRegionSize), proper_unit_for_byte_size(ShenandoahMinRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahHeapRegionSize option", message);
vm_exit_during_initialization("Invalid -XX:ShenandoahRegionSize option", message);
}
if (ShenandoahHeapRegionSize > ShenandoahMaxRegionSize) {
if (ShenandoahRegionSize > ShenandoahMaxRegionSize) {
err_msg message("Heap region size (" SIZE_FORMAT "%s) should be lower than max region size (" SIZE_FORMAT "%s).",
byte_size_in_proper_unit(ShenandoahHeapRegionSize), proper_unit_for_byte_size(ShenandoahHeapRegionSize),
byte_size_in_proper_unit(ShenandoahRegionSize), proper_unit_for_byte_size(ShenandoahRegionSize),
byte_size_in_proper_unit(ShenandoahMaxRegionSize), proper_unit_for_byte_size(ShenandoahMaxRegionSize));
vm_exit_during_initialization("Invalid -XX:ShenandoahHeapRegionSize option", message);
vm_exit_during_initialization("Invalid -XX:ShenandoahRegionSize option", message);
}
region_size = ShenandoahHeapRegionSize;
region_size = ShenandoahRegionSize;
}

// Make sure region size is at least one large page, if enabled.
@@ -40,7 +40,7 @@
range, \
constraint) \
\
experimental(size_t, ShenandoahHeapRegionSize, 0, \
experimental(size_t, ShenandoahRegionSize, 0, \
"Static heap region size. Set zero to enable automatic sizing.") \
\
experimental(size_t, ShenandoahTargetNumRegions, 2048, \
@@ -52,8 +52,8 @@
* @requires vm.gc.Shenandoah & !vm.graal.enabled
* @bug 8151499 8153734
* @modules java.base/jdk.internal.vm.annotation
* @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xms128m -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahHeapRegionSize=8M -XX:ContendedPaddingWidth=8192 gc.TestHumongousReferenceObject
* @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xms128m -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahHeapRegionSize=8M -XX:ContendedPaddingWidth=8192 -XX:+UnlockDiagnosticVMOptions -XX:+ShenandoahVerify gc.TestHumongousReferenceObject
* @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xms128m -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahRegionSize=8M -XX:ContendedPaddingWidth=8192 gc.TestHumongousReferenceObject
* @run main/othervm -XX:+EnableContended -XX:-RestrictContended -Xms128m -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahRegionSize=8M -XX:ContendedPaddingWidth=8192 -XX:+UnlockDiagnosticVMOptions -XX:+ShenandoahVerify gc.TestHumongousReferenceObject
*/
public class TestHumongousReferenceObject {

@@ -70,10 +70,10 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms100m",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=200m",
"-XX:ShenandoahRegionSize=200m",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldMatch("Invalid -XX:ShenandoahHeapRegionSize option");
output.shouldMatch("Invalid -XX:ShenandoahRegionSize option");
output.shouldHaveExitValue(1);
}

@@ -82,7 +82,7 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms100m",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=9m",
"-XX:ShenandoahRegionSize=9m",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
@@ -93,10 +93,10 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms100m",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=255K",
"-XX:ShenandoahRegionSize=255K",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldMatch("Invalid -XX:ShenandoahHeapRegionSize option");
output.shouldMatch("Invalid -XX:ShenandoahRegionSize option");
output.shouldHaveExitValue(1);
}

@@ -105,7 +105,7 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms100m",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=260K",
"-XX:ShenandoahRegionSize=260K",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
@@ -116,7 +116,7 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms1g",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=32M",
"-XX:ShenandoahRegionSize=32M",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
@@ -127,10 +127,10 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms1g",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=64M",
"-XX:ShenandoahRegionSize=64M",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldMatch("Invalid -XX:ShenandoahHeapRegionSize option");
output.shouldMatch("Invalid -XX:ShenandoahRegionSize option");
output.shouldHaveExitValue(1);
}

@@ -139,7 +139,7 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms1g",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=256K",
"-XX:ShenandoahRegionSize=256K",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
@@ -150,10 +150,10 @@ private static void testInvalidRegionSizes() throws Exception {
"-XX:+UseShenandoahGC",
"-Xms1g",
"-Xmx1g",
"-XX:ShenandoahHeapRegionSize=128K",
"-XX:ShenandoahRegionSize=128K",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldMatch("Invalid -XX:ShenandoahHeapRegionSize option");
output.shouldMatch("Invalid -XX:ShenandoahRegionSize option");
output.shouldHaveExitValue(1);
}
}

0 comments on commit cd76575

Please sign in to comment.