提交 84626e9a 编写于 作者: T tschatzl

Merge

...@@ -35,7 +35,9 @@ define_pd_global(intx, CompilerThreadStackSize, 0); ...@@ -35,7 +35,9 @@ define_pd_global(intx, CompilerThreadStackSize, 0);
// Used on 64 bit platforms for UseCompressedOops base address // Used on 64 bit platforms for UseCompressedOops base address
#ifdef _LP64 #ifdef _LP64
define_pd_global(uintx, HeapBaseMinAddress, CONST64(4)*G); // use 6G as default base address because by default the OS maps the application
// to 4G on Solaris-Sparc. This leaves at least 2G for the native heap.
define_pd_global(uintx, HeapBaseMinAddress, CONST64(6)*G);
#else #else
define_pd_global(uintx, HeapBaseMinAddress, 2*G); define_pd_global(uintx, HeapBaseMinAddress, 2*G);
#endif #endif
......
...@@ -42,10 +42,10 @@ class DetermineMaxHeapForCompressedOops { ...@@ -42,10 +42,10 @@ class DetermineMaxHeapForCompressedOops {
class TestUseCompressedOopsErgoTools { class TestUseCompressedOopsErgoTools {
private static long getClassMetaspaceSize() { private static long getCompressedClassSpaceSize() {
HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
VMOption option = diagnostic.getVMOption("ClassMetaspaceSize"); VMOption option = diagnostic.getVMOption("CompressedClassSpaceSize");
return Long.parseLong(option.getValue()); return Long.parseLong(option.getValue());
} }
...@@ -132,13 +132,13 @@ class TestUseCompressedOopsErgoTools { ...@@ -132,13 +132,13 @@ class TestUseCompressedOopsErgoTools {
checkUseCompressedOops(join(gcflags, "-XX:ObjectAlignmentInBytes=16"), maxHeapForCompressedOops - 1, true); checkUseCompressedOops(join(gcflags, "-XX:ObjectAlignmentInBytes=16"), maxHeapForCompressedOops - 1, true);
checkUseCompressedOops(join(gcflags, "-XX:ObjectAlignmentInBytes=16"), maxHeapForCompressedOops + 1, false); checkUseCompressedOops(join(gcflags, "-XX:ObjectAlignmentInBytes=16"), maxHeapForCompressedOops + 1, false);
// use a different ClassMetaspaceSize // use a different CompressedClassSpaceSize
String classMetaspaceSizeArg = "-XX:ClassMetaspaceSize=" + 2 * getClassMetaspaceSize(); String compressedClassSpaceSizeArg = "-XX:CompressedClassSpaceSize=" + 2 * getCompressedClassSpaceSize();
maxHeapForCompressedOops = getMaxHeapForCompressedOops(join(gcflags, classMetaspaceSizeArg)); maxHeapForCompressedOops = getMaxHeapForCompressedOops(join(gcflags, compressedClassSpaceSizeArg));
checkUseCompressedOops(join(gcflags, classMetaspaceSizeArg), maxHeapForCompressedOops, true); checkUseCompressedOops(join(gcflags, compressedClassSpaceSizeArg), maxHeapForCompressedOops, true);
checkUseCompressedOops(join(gcflags, classMetaspaceSizeArg), maxHeapForCompressedOops - 1, true); checkUseCompressedOops(join(gcflags, compressedClassSpaceSizeArg), maxHeapForCompressedOops - 1, true);
checkUseCompressedOops(join(gcflags, classMetaspaceSizeArg), maxHeapForCompressedOops + 1, false); checkUseCompressedOops(join(gcflags, compressedClassSpaceSizeArg), maxHeapForCompressedOops + 1, false);
} }
private static void checkUseCompressedOops(String[] args, long heapsize, boolean expectUseCompressedOops) throws Exception { private static void checkUseCompressedOops(String[] args, long heapsize, boolean expectUseCompressedOops) throws Exception {
...@@ -152,9 +152,7 @@ class TestUseCompressedOopsErgoTools { ...@@ -152,9 +152,7 @@ class TestUseCompressedOopsErgoTools {
boolean actualUseCompressedOops = getFlagBoolValue(" UseCompressedOops", output); boolean actualUseCompressedOops = getFlagBoolValue(" UseCompressedOops", output);
if (expectUseCompressedOops != actualUseCompressedOops) { Asserts.assertEQ(expectUseCompressedOops, actualUseCompressedOops);
throw new RuntimeException("Expected use of compressed oops: " + expectUseCompressedOops + " but was: " + actualUseCompressedOops);
}
} }
private static boolean getFlagBoolValue(String flag, String where) { private static boolean getFlagBoolValue(String flag, String where) {
...@@ -162,7 +160,7 @@ class TestUseCompressedOopsErgoTools { ...@@ -162,7 +160,7 @@ class TestUseCompressedOopsErgoTools {
if (!m.find()) { if (!m.find()) {
throw new RuntimeException("Could not find value for flag " + flag + " in output string"); throw new RuntimeException("Could not find value for flag " + flag + " in output string");
} }
String match = m.group(1).equals("true"); return m.group(1).equals("true");
} }
private static String expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception { private static String expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册