8028254: gc/arguments/TestMinInitialErgonomics.java failed with unexpected initial heap size
Reviewed-by: brutisso, tschatzl, sjohanss
--- a/hotspot/src/share/vm/prims/whitebox.cpp Mon Feb 03 10:49:49 2014 +0100
+++ b/hotspot/src/share/vm/prims/whitebox.cpp Wed Feb 05 10:09:54 2014 +0100
@@ -105,7 +105,7 @@
WB_ENTRY(void, WB_PrintHeapSizes(JNIEnv* env, jobject o)) {
CollectorPolicy * p = Universe::heap()->collector_policy();
gclog_or_tty->print_cr("Minimum heap "SIZE_FORMAT" Initial heap "
- SIZE_FORMAT" Maximum heap "SIZE_FORMAT" Min alignment "SIZE_FORMAT" Max alignment "SIZE_FORMAT,
+ SIZE_FORMAT" Maximum heap "SIZE_FORMAT" Space alignment "SIZE_FORMAT" Heap alignment "SIZE_FORMAT,
p->min_heap_byte_size(), p->initial_heap_byte_size(), p->max_heap_byte_size(),
p->space_alignment(), p->heap_alignment());
}
--- a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java Mon Feb 03 10:49:49 2014 +0100
+++ b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java Wed Feb 05 10:09:54 2014 +0100
@@ -41,8 +41,8 @@
public long initialHeapSize;
public long maxHeapSize;
- public long minAlignment;
- public long maxAlignment;
+ public long spaceAlignment;
+ public long heapAlignment;
}
class TestMaxHeapSizeTools {
@@ -192,7 +192,7 @@
// Unfortunately there is no other way to retrieve the minimum heap size and
// the alignments.
- Matcher m = Pattern.compile("Minimum heap \\d+ Initial heap \\d+ Maximum heap \\d+ Min alignment \\d+ Max alignment \\d+").
+ Matcher m = Pattern.compile("Minimum heap \\d+ Initial heap \\d+ Maximum heap \\d+ Space alignment \\d+ Heap alignment \\d+").
matcher(output.getStdout());
if (!m.find()) {
throw new RuntimeException("Could not find heap size string.");
@@ -204,8 +204,8 @@
val.minHeapSize = valueAfter(match, "Minimum heap ");
val.initialHeapSize = valueAfter(match, "Initial heap ");
val.maxHeapSize = valueAfter(match, "Maximum heap ");
- val.minAlignment = valueAfter(match, "Min alignment ");
- val.maxAlignment = valueAfter(match, "Max alignment ");
+ val.spaceAlignment = valueAfter(match, "Space alignment ");
+ val.heapAlignment = valueAfter(match, "Heap alignment ");
}
/**
@@ -218,12 +218,12 @@
MinInitialMaxValues v = new MinInitialMaxValues();
getMinInitialMaxHeap(args, v);
- if ((expectedMin != -1) && (align_up(expectedMin, v.minAlignment) != v.minHeapSize)) {
+ if ((expectedMin != -1) && (align_up(expectedMin, v.heapAlignment) != v.minHeapSize)) {
throw new RuntimeException("Actual minimum heap size of " + v.minHeapSize +
" differs from expected minimum heap size of " + expectedMin);
}
- if ((expectedInitial != -1) && (align_up(expectedInitial, v.minAlignment) != v.initialHeapSize)) {
+ if ((expectedInitial != -1) && (align_up(expectedInitial, v.heapAlignment) != v.initialHeapSize)) {
throw new RuntimeException("Actual initial heap size of " + v.initialHeapSize +
" differs from expected initial heap size of " + expectedInitial);
}
@@ -247,7 +247,7 @@
MinInitialMaxValues v = new MinInitialMaxValues();
getMinInitialMaxHeap(new String[] { gcflag, "-XX:MaxHeapSize=" + maxHeapsize + "M" }, v);
- long expectedHeapSize = align_up(maxHeapsize * K * K, v.maxAlignment);
+ long expectedHeapSize = align_up(maxHeapsize * K * K, v.heapAlignment);
long actualHeapSize = v.maxHeapSize;
if (actualHeapSize > expectedHeapSize) {