# HG changeset patch # User tschatzl # Date 1379512781 -7200 # Node ID 8d5366a97afafa73b0e568f17affed338c8ddab0 # Parent 7446501f55bc7d247a7aa6eebb8e5133249b5772# Parent 1ea8bd3b6624eb794b909d28afd2756aff2e19bd Merge diff -r 7446501f55bc -r 8d5366a97afa hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp --- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp Tue Sep 17 20:59:07 2013 +0200 +++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp Wed Sep 18 15:59:41 2013 +0200 @@ -35,7 +35,9 @@ // Used on 64 bit platforms for UseCompressedOops base address #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 define_pd_global(uintx, HeapBaseMinAddress, 2*G); #endif diff -r 7446501f55bc -r 8d5366a97afa hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java --- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java Tue Sep 17 20:59:07 2013 +0200 +++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java Wed Sep 18 15:59:41 2013 +0200 @@ -42,10 +42,10 @@ class TestUseCompressedOopsErgoTools { - private static long getClassMetaspaceSize() { + private static long getCompressedClassSpaceSize() { HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); - VMOption option = diagnostic.getVMOption("ClassMetaspaceSize"); + VMOption option = diagnostic.getVMOption("CompressedClassSpaceSize"); return Long.parseLong(option.getValue()); } @@ -132,13 +132,13 @@ checkUseCompressedOops(join(gcflags, "-XX:ObjectAlignmentInBytes=16"), maxHeapForCompressedOops - 1, true); checkUseCompressedOops(join(gcflags, "-XX:ObjectAlignmentInBytes=16"), maxHeapForCompressedOops + 1, false); - // use a different ClassMetaspaceSize - String classMetaspaceSizeArg = "-XX:ClassMetaspaceSize=" + 2 * getClassMetaspaceSize(); - maxHeapForCompressedOops = getMaxHeapForCompressedOops(join(gcflags, classMetaspaceSizeArg)); + // use a different CompressedClassSpaceSize + String compressedClassSpaceSizeArg = "-XX:CompressedClassSpaceSize=" + 2 * getCompressedClassSpaceSize(); + maxHeapForCompressedOops = getMaxHeapForCompressedOops(join(gcflags, compressedClassSpaceSizeArg)); - checkUseCompressedOops(join(gcflags, classMetaspaceSizeArg), maxHeapForCompressedOops, true); - checkUseCompressedOops(join(gcflags, classMetaspaceSizeArg), maxHeapForCompressedOops - 1, true); - checkUseCompressedOops(join(gcflags, classMetaspaceSizeArg), maxHeapForCompressedOops + 1, false); + checkUseCompressedOops(join(gcflags, compressedClassSpaceSizeArg), maxHeapForCompressedOops, true); + checkUseCompressedOops(join(gcflags, compressedClassSpaceSizeArg), maxHeapForCompressedOops - 1, true); + checkUseCompressedOops(join(gcflags, compressedClassSpaceSizeArg), maxHeapForCompressedOops + 1, false); } private static void checkUseCompressedOops(String[] args, long heapsize, boolean expectUseCompressedOops) throws Exception { @@ -152,9 +152,7 @@ boolean actualUseCompressedOops = getFlagBoolValue(" UseCompressedOops", output); - if (expectUseCompressedOops != actualUseCompressedOops) { - throw new RuntimeException("Expected use of compressed oops: " + expectUseCompressedOops + " but was: " + actualUseCompressedOops); - } + Asserts.assertEQ(expectUseCompressedOops, actualUseCompressedOops); } private static boolean getFlagBoolValue(String flag, String where) { @@ -162,7 +160,7 @@ if (!m.find()) { 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 {