提交 ab306b43 编写于 作者: E ehelin

8028254: gc/arguments/TestMinInitialErgonomics.java failed with unexpected initial heap size

Reviewed-by: brutisso, tschatzl, sjohanss
上级 836aa407
......@@ -171,7 +171,7 @@ WB_END
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());
}
......
......@@ -41,8 +41,8 @@ final class MinInitialMaxValues {
public long initialHeapSize;
public long maxHeapSize;
public long minAlignment;
public long maxAlignment;
public long spaceAlignment;
public long heapAlignment;
}
class TestMaxHeapSizeTools {
......@@ -192,7 +192,7 @@ class TestMaxHeapSizeTools {
// 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 @@ class TestMaxHeapSizeTools {
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 @@ class TestMaxHeapSizeTools {
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 @@ class TestMaxHeapSizeTools {
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册