Mercurial > hg > graal-compiler
annotate test/gc/g1/Test2GbHeap.java @ 14817:80147dac0d6e
LIRFrameStateBuilder added
author | Niclas Adlertz <niclas.adlertz@oracle.com> |
---|---|
date | Tue, 18 Mar 2014 09:56:20 +0000 |
parents | e9fc29d2e8ae |
children |
rev | line source |
---|---|
14311
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
1 /* |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
4 * |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
8 * |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
13 * accompanied this code). |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
14 * |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
18 * |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
21 * questions. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
22 */ |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
23 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
24 /* |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
25 * @test Test2GbHeap |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
26 * @bug 8031686 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
27 * @summary Regression test to ensure we can start G1 with 2gb heap. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
28 * @key gc |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
29 * @key regression |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
30 * @library /testlibrary |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
31 */ |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
32 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
33 import java.util.ArrayList; |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
34 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
35 import com.oracle.java.testlibrary.OutputAnalyzer; |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
36 import com.oracle.java.testlibrary.ProcessTools; |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
37 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
38 public class Test2GbHeap { |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
39 public static void main(String[] args) throws Exception { |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
40 ArrayList<String> testArguments = new ArrayList<String>(); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
41 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
42 testArguments.add("-XX:+UseG1GC"); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
43 testArguments.add("-Xmx2g"); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
44 testArguments.add("-version"); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
45 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
46 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testArguments.toArray(new String[0])); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
47 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
48 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
49 |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
50 // Avoid failing test for setups not supported. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
51 if (output.getOutput().contains("Could not reserve enough space for 2097152KB object heap")) { |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
52 // Will fail on machines with too little memory (and Windows 32-bit VM), ignore such failures. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
53 output.shouldHaveExitValue(1); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
54 } else if (output.getOutput().contains("G1 GC is disabled in this release")) { |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
55 // G1 is not supported on embedded, ignore such failures. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
56 output.shouldHaveExitValue(1); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
57 } else { |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
58 // Normally everything should be fine. |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
59 output.shouldHaveExitValue(0); |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
60 } |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
61 } |
e9fc29d2e8ae
8031686: G1: assert(_hrs.max_length() == _expansion_regions) failed
sjohanss
parents:
diff
changeset
|
62 } |