Mercurial > hg > graal-compiler
annotate test/gc/g1/TestGCLogMessages.java @ 17756:a07bea31ef35
8035398: Add card redirty time in "Other" time in G1
Summary: Show the time taken by card redirtying during GC in a new "Redirty Cards" line.
Reviewed-by: jwilhelm, brutisso
author | tschatzl |
---|---|
date | Mon, 24 Mar 2014 15:30:40 +0100 |
parents | 96b1c2e06e25 |
children | eff02b5bd56c |
rev | line source |
---|---|
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
1 /* |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
4 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
8 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
13 * accompanied this code). |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
14 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
18 * |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
21 * questions. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
22 */ |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
23 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
24 /* |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
25 * @test TestPrintGCDetails |
17756
a07bea31ef35
8035398: Add card redirty time in "Other" time in G1
tschatzl
parents:
17755
diff
changeset
|
26 * @bug 8035406 8027295 8035398 |
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
27 * @summary Ensure that the PrintGCDetails output for a minor GC with G1 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
28 * includes the expected necessary messages. |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
29 * @key gc |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
30 * @library /testlibrary |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
31 */ |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
32 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
33 import com.oracle.java.testlibrary.ProcessTools; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
34 import com.oracle.java.testlibrary.OutputAnalyzer; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
35 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
36 public class TestGCLogMessages { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
37 public static void main(String[] args) throws Exception { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
38 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
39 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
40 "-Xmx10M", |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
41 GCTest.class.getName()); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
42 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
43 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
44 |
17756
a07bea31ef35
8035398: Add card redirty time in "Other" time in G1
tschatzl
parents:
17755
diff
changeset
|
45 output.shouldNotContain("[Redirty Cards"); |
17755
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
46 output.shouldNotContain("[Code Root Purge"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
47 output.shouldNotContain("[Young Free CSet"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
48 output.shouldNotContain("[Non-Young Free CSet"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
49 output.shouldHaveExitValue(0); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
50 |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
51 pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
52 "-Xmx10M", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
53 "-XX:+PrintGCDetails", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
54 GCTest.class.getName()); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
55 |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
56 output = new OutputAnalyzer(pb.start()); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
57 |
17756
a07bea31ef35
8035398: Add card redirty time in "Other" time in G1
tschatzl
parents:
17755
diff
changeset
|
58 output.shouldContain("[Redirty Cards"); |
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
59 output.shouldContain("[Code Root Purge"); |
17755
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
60 output.shouldNotContain("[Young Free CSet"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
61 output.shouldNotContain("[Non-Young Free CSet"); |
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
62 output.shouldHaveExitValue(0); |
17755
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
63 |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
64 pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
65 "-Xmx10M", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
66 "-XX:+PrintGCDetails", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
67 "-XX:+UnlockExperimentalVMOptions", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
68 "-XX:G1LogLevel=finest", |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
69 GCTest.class.getName()); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
70 |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
71 output = new OutputAnalyzer(pb.start()); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
72 |
17756
a07bea31ef35
8035398: Add card redirty time in "Other" time in G1
tschatzl
parents:
17755
diff
changeset
|
73 output.shouldContain("[Redirty Cards"); |
17755
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
74 output.shouldContain("[Code Root Purge"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
75 output.shouldContain("[Young Free CSet"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
76 output.shouldContain("[Non-Young Free CSet"); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
77 output.shouldHaveExitValue(0); |
96b1c2e06e25
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
17753
diff
changeset
|
78 |
17753
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
79 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
80 |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
81 static class GCTest { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
82 private static byte[] garbage; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
83 public static void main(String [] args) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
84 System.out.println("Creating garbage"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
85 // create 128MB of garbage. This should result in at least one GC |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
86 for (int i = 0; i < 1024; i++) { |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
87 garbage = new byte[128 * 1024]; |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
88 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
89 System.out.println("Done"); |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
90 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
91 } |
191174b49bec
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
92 } |