annotate test/gc/g1/TestPrintGCDetails.java @ 20972:a69a7c0e0ccc

Remove ValuePosition machinery
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 07 Apr 2015 12:09:46 -0700
parents 48391ab0687e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10291
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
1 /*
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
4 *
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
7 * published by the Free Software Foundation.
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
8 *
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
13 * accompanied this code).
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
14 *
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
18 *
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
21 * questions.
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
22 */
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
23
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
24 /*
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
25 * @test TestPrintGCDetails
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
26 * @bug 8010738
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
27 * @summary Ensure that the PrintGCDetails for a full GC with G1 includes Metaspace.
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
28 * @key gc
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
29 * @key regression
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
30 * @library /testlibrary
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
31 */
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
32
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
33 import com.oracle.java.testlibrary.ProcessTools;
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
34 import com.oracle.java.testlibrary.OutputAnalyzer;
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
35
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
36 public class TestPrintGCDetails {
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
37 public static void main(String[] args) throws Exception {
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
38
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
39 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
40 "-XX:+PrintGCDetails",
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
41 SystemGCTest.class.getName());
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
42
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
43 OutputAnalyzer output = new OutputAnalyzer(pb.start());
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
44
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
45 System.out.println("Output:\n" + output.getOutput());
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
46
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
47 output.shouldContain("Metaspace");
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
48 output.shouldHaveExitValue(0);
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
49 }
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
50
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
51 static class SystemGCTest {
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
52 public static void main(String [] args) {
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
53 System.out.println("Calling System.gc()");
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
54 System.gc();
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
55 }
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
56 }
48391ab0687e 8010738: G1: Output for full GCs with +PrintGCDetails should contain perm gen size/meta data change info
johnc
parents:
diff changeset
57 }