author | tschatzl |
Mon, 17 Mar 2014 10:13:18 +0100 | |
changeset 23453 | 09cfb0164acf |
parent 23451 | ed2b8bb28fed |
child 23454 | 13a3b426f64d |
permissions | -rw-r--r-- |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
1 |
/* |
ed2b8bb28fed
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. |
ed2b8bb28fed
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. |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
4 |
* |
ed2b8bb28fed
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 |
ed2b8bb28fed
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 |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
8 |
* |
ed2b8bb28fed
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 |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ed2b8bb28fed
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 |
ed2b8bb28fed
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 |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
13 |
* accompanied this code). |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
14 |
* |
ed2b8bb28fed
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 |
ed2b8bb28fed
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, |
ed2b8bb28fed
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. |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
18 |
* |
ed2b8bb28fed
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 |
ed2b8bb28fed
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 |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
21 |
* questions. |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
22 |
*/ |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
23 |
|
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
24 |
/* |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
25 |
* @test TestPrintGCDetails |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
26 |
* @bug 8035406 8027295 |
23451
ed2b8bb28fed
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 |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
28 |
* includes the expected necessary messages. |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
29 |
* @key gc |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
30 |
* @library /testlibrary |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
31 |
*/ |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
32 |
|
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
33 |
import com.oracle.java.testlibrary.ProcessTools; |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
34 |
import com.oracle.java.testlibrary.OutputAnalyzer; |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
35 |
|
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
36 |
public class TestGCLogMessages { |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
37 |
public static void main(String[] args) throws Exception { |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
38 |
|
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
39 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
40 |
"-Xmx10M", |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
41 |
GCTest.class.getName()); |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
42 |
|
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
43 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
44 |
|
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
45 |
output.shouldNotContain("[Code Root Purge"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
46 |
output.shouldNotContain("[Young Free CSet"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
47 |
output.shouldNotContain("[Non-Young Free CSet"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
48 |
output.shouldHaveExitValue(0); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
49 |
|
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
50 |
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
51 |
"-Xmx10M", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
52 |
"-XX:+PrintGCDetails", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
53 |
GCTest.class.getName()); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
54 |
|
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
55 |
output = new OutputAnalyzer(pb.start()); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
56 |
|
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
57 |
output.shouldContain("[Code Root Purge"); |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
58 |
output.shouldNotContain("[Young Free CSet"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
59 |
output.shouldNotContain("[Non-Young Free CSet"); |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
60 |
output.shouldHaveExitValue(0); |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
61 |
|
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
62 |
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
63 |
"-Xmx10M", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
64 |
"-XX:+PrintGCDetails", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
65 |
"-XX:+UnlockExperimentalVMOptions", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
66 |
"-XX:G1LogLevel=finest", |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
67 |
GCTest.class.getName()); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
68 |
|
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
69 |
output = new OutputAnalyzer(pb.start()); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
70 |
|
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
71 |
output.shouldContain("[Code Root Purge"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
72 |
output.shouldContain("[Young Free CSet"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
73 |
output.shouldContain("[Non-Young Free CSet"); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
74 |
output.shouldHaveExitValue(0); |
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
75 |
|
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
76 |
} |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
77 |
|
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
78 |
static class GCTest { |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
79 |
private static byte[] garbage; |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
80 |
public static void main(String [] args) { |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
81 |
System.out.println("Creating garbage"); |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
82 |
// create 128MB of garbage. This should result in at least one GC |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
83 |
for (int i = 0; i < 1024; i++) { |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
84 |
garbage = new byte[128 * 1024]; |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
85 |
} |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
86 |
System.out.println("Done"); |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
87 |
} |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
88 |
} |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
89 |
} |