Mercurial > hg > truffle
annotate test/gc/arguments/TestG1HeapRegionSize.java @ 13330:1f4c9729c9f0
add base class for new object nodes, simplification to remove new objects without real usages
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 13 Dec 2013 22:43:21 +0100 |
parents | dae8324fc7d1 |
children |
rev | line source |
---|---|
11978
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
1 /* |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
4 * |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
8 * |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
13 * accompanied this code). |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
14 * |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
18 * |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
21 * questions. |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
22 */ |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
23 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
24 /* |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
25 * @test TestG1HeapRegionSize |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
26 * @key gc |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
27 * @bug 8021879 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
28 * @summary Verify that the flag G1HeapRegionSize is updated properly |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
29 * @run main/othervm -Xmx64m TestG1HeapRegionSize 1048576 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
30 * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m TestG1HeapRegionSize 2097152 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
31 * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m TestG1HeapRegionSize 2097152 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
32 * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m TestG1HeapRegionSize 33554432 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
33 */ |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
34 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
35 import sun.management.ManagementFactoryHelper; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
36 import com.sun.management.HotSpotDiagnosticMXBean; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
37 import com.sun.management.VMOption; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
38 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
39 public class TestG1HeapRegionSize { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
40 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
41 public static void main(String[] args) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
42 HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
43 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
44 VMOption option = diagnostic.getVMOption("UseG1GC"); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
45 if (option.getValue().equals("false")) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
46 System.out.println("Skipping this test. It is only a G1 test."); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
47 return; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
48 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
49 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
50 String expectedValue = getExpectedValue(args); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
51 option = diagnostic.getVMOption("G1HeapRegionSize"); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
52 if (!expectedValue.equals(option.getValue())) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
53 throw new RuntimeException("Wrong value for G1HeapRegionSize. Expected " + expectedValue + " but got " + option.getValue()); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
54 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
55 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
56 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
57 private static String getExpectedValue(String[] args) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
58 if (args.length != 1) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
59 throw new RuntimeException("Wrong number of arguments. Expected 1 but got " + args.length); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
60 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
61 return args[0]; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
62 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
63 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
64 } |