Mercurial > hg > graal-jvmci-8
annotate test/gc/arguments/TestG1HeapRegionSize.java @ 23914:b5ecd8067e89 jdk8u102-b09
Merge
author | asaha |
---|---|
date | Mon, 23 May 2016 20:38:07 -0700 |
parents | f967da7f0c3c |
children |
rev | line source |
---|---|
11978
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
1 /* |
22981
f967da7f0c3c
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
jwilhelm
parents:
11978
diff
changeset
|
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
11978
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 |
22981
f967da7f0c3c
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
jwilhelm
parents:
11978
diff
changeset
|
28 * @requires vm.gc=="G1" | vm.gc=="null" |
11978
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
29 * @summary Verify that the flag G1HeapRegionSize is updated properly |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
30 * @run main/othervm -Xmx64m TestG1HeapRegionSize 1048576 |
22981
f967da7f0c3c
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
jwilhelm
parents:
11978
diff
changeset
|
31 * @run main/othervm -XX:G1HeapRegionSize=2m -Xmx64m -XX:+UseG1GC TestG1HeapRegionSize 2097152 |
f967da7f0c3c
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
jwilhelm
parents:
11978
diff
changeset
|
32 * @run main/othervm -XX:G1HeapRegionSize=3m -Xmx64m -XX:+UseG1GC TestG1HeapRegionSize 2097152 |
f967da7f0c3c
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
jwilhelm
parents:
11978
diff
changeset
|
33 * @run main/othervm -XX:G1HeapRegionSize=64m -Xmx256m -XX:+UseG1GC TestG1HeapRegionSize 33554432 |
11978
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 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
36 import sun.management.ManagementFactoryHelper; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
37 import com.sun.management.HotSpotDiagnosticMXBean; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
38 import com.sun.management.VMOption; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
39 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
40 public class TestG1HeapRegionSize { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
41 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
42 public static void main(String[] args) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
43 HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
44 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
45 String expectedValue = getExpectedValue(args); |
22981
f967da7f0c3c
8062537: [TESTBUG] Conflicting GC combinations in hotspot tests
jwilhelm
parents:
11978
diff
changeset
|
46 VMOption option = diagnostic.getVMOption("G1HeapRegionSize"); |
11978
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
47 if (!expectedValue.equals(option.getValue())) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
48 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
|
49 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
50 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
51 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
52 private static String getExpectedValue(String[] args) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
53 if (args.length != 1) { |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
54 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
|
55 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
56 return args[0]; |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
57 } |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
58 |
dae8324fc7d1
8021879: G1: G1HeapRegionSize flag value not updated correctly
brutisso
parents:
diff
changeset
|
59 } |