Mercurial > hg > truffle
comparison test/runtime/CompressedOops/CompressedClassPointers.java @ 14474:de7f1b016d55
7014526: "java -version" crash on sparc with some values of HeapBaseMinAddress
Summary: Make default HeapBaseMinAddress the minimum that can be specified.
Reviewed-by: minqi, kvn, tschatzl, dholmes
author | coleenp |
---|---|
date | Wed, 19 Feb 2014 02:58:13 +0000 |
parents | 209aa13ab8c0 |
children | 4adcdd3ccb66 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14382:805784307dca | 14474:de7f1b016d55 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
78 OutputAnalyzer output = new OutputAnalyzer(pb.start()); | 78 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
79 output.shouldContain("Narrow klass base:"); | 79 output.shouldContain("Narrow klass base:"); |
80 output.shouldHaveExitValue(0); | 80 output.shouldHaveExitValue(0); |
81 } | 81 } |
82 | 82 |
83 public static void heapBaseMinAddressTest() throws Exception { | |
84 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( | |
85 "-XX:HeapBaseMinAddress=1m", | |
86 "-XX:+PrintMiscellaneous", | |
87 "-XX:+Verbose", | |
88 "-version"); | |
89 OutputAnalyzer output = new OutputAnalyzer(pb.start()); | |
90 output.shouldContain("HeapBaseMinAddress must be at least"); | |
91 output.shouldContain("HotSpot"); | |
92 output.shouldHaveExitValue(0); | |
93 } | |
94 | |
83 public static void sharingTest() throws Exception { | 95 public static void sharingTest() throws Exception { |
84 // Test small heaps | 96 // Test small heaps |
85 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( | 97 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
86 "-XX:+UnlockDiagnosticVMOptions", | 98 "-XX:+UnlockDiagnosticVMOptions", |
87 "-XX:SharedArchiveFile=./sample.jsa", | 99 "-XX:SharedArchiveFile=./sample.jsa", |
111 output.shouldContain("Unable to use shared archive"); | 123 output.shouldContain("Unable to use shared archive"); |
112 output.shouldHaveExitValue(1); | 124 output.shouldHaveExitValue(1); |
113 } | 125 } |
114 } | 126 } |
115 | 127 |
116 public static void main(String[] args) throws Exception { | 128 public static void main(String[] args) throws Exception { |
117 if (!Platform.is64bit()) { | 129 if (!Platform.is64bit()) { |
118 // Can't test this on 32 bit, just pass | 130 // Can't test this on 32 bit, just pass |
119 System.out.println("Skipping test on 32bit"); | 131 System.out.println("Skipping test on 32bit"); |
120 return; | 132 return; |
121 } | 133 } |
122 // Solaris 10 can't mmap compressed oops space without a base | 134 // Solaris 10 can't mmap compressed oops space without a base |
123 if (Platform.isSolaris()) { | 135 if (Platform.isSolaris()) { |
124 String name = System.getProperty("os.version"); | 136 String name = System.getProperty("os.version"); |
125 if (name.equals("5.10")) { | 137 if (name.equals("5.10")) { |
126 System.out.println("Skipping test on Solaris 10"); | 138 System.out.println("Skipping test on Solaris 10"); |
127 return; | 139 return; |
128 } | 140 } |
129 } | 141 } |
130 smallHeapTest(); | 142 smallHeapTest(); |
131 smallHeapTestWith3G(); | 143 smallHeapTestWith3G(); |
132 largeHeapTest(); | 144 largeHeapTest(); |
133 largePagesTest(); | 145 largePagesTest(); |
134 sharingTest(); | 146 heapBaseMinAddressTest(); |
135 } | 147 sharingTest(); |
148 } | |
136 } | 149 } |