author | tschatzl |
Wed, 09 Aug 2017 17:27:42 +0200 | |
changeset 46778 | f504c6f2eea5 |
parent 46670 | 55a3c36b64b2 |
child 46795 | 623a5e42deb6 |
permissions | -rw-r--r-- |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
1 |
/* |
46358
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
2 |
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
23451
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 |
/* |
24467
886598231964
8038928: gc/g1/TestGCLogMessages.java fail with "[Evacuation Failure'
jmasa
parents:
24104
diff
changeset
|
25 |
* @test TestGCLogMessages |
46456
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
26 |
* @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330 8076463 8150630 8160055 8177059 8166191 |
35061 | 27 |
* @summary Ensure the output for a minor GC with G1 |
23451
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 |
40886 | 30 |
* @requires vm.gc.G1 |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
39979
diff
changeset
|
31 |
* @library /test/lib |
36851 | 32 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28497
diff
changeset
|
33 |
* java.management |
42048
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
34 |
* @build sun.hotspot.WhiteBox |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
35 |
* @run main ClassFileInstaller sun.hotspot.WhiteBox |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
36 |
* @run main TestGCLogMessages |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
37 |
*/ |
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
38 |
|
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
39979
diff
changeset
|
39 |
import jdk.test.lib.process.OutputAnalyzer; |
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
39979
diff
changeset
|
40 |
import jdk.test.lib.process.ProcessTools; |
46358
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
41 |
import jdk.test.lib.Platform; |
23451
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 |
public class TestGCLogMessages { |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
23454
diff
changeset
|
44 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
45 |
private enum Level { |
36374 | 46 |
OFF(""), |
47 |
INFO("info"), |
|
48 |
DEBUG("debug"), |
|
49 |
TRACE("trace"); |
|
50 |
||
51 |
private String logName; |
|
52 |
||
53 |
Level(String logName) { |
|
54 |
this.logName = logName; |
|
55 |
} |
|
56 |
||
57 |
public boolean lessThan(Level other) { |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
58 |
return this.compareTo(other) < 0; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
59 |
} |
36374 | 60 |
|
61 |
public String toString() { |
|
62 |
return logName; |
|
63 |
} |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
64 |
} |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
65 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
66 |
private class LogMessageWithLevel { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
67 |
String message; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
68 |
Level level; |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
69 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
70 |
public LogMessageWithLevel(String message, Level level) { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
71 |
this.message = message; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
72 |
this.level = level; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
73 |
} |
46358
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
74 |
|
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
75 |
public boolean isAvailable() { |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
76 |
return true; |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
77 |
} |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
78 |
}; |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
79 |
|
46358
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
80 |
private class LogMessageWithLevelC2OrJVMCIOnly extends LogMessageWithLevel { |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
81 |
public LogMessageWithLevelC2OrJVMCIOnly(String message, Level level) { |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
82 |
super(message, level); |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
83 |
} |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
84 |
|
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
85 |
public boolean isAvailable() { |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
86 |
return Platform.isGraal() || Platform.isServer(); |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
87 |
} |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
88 |
} |
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
89 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
90 |
private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] { |
42557 | 91 |
new LogMessageWithLevel("Pre Evacuate Collection Set", Level.INFO), |
92 |
new LogMessageWithLevel("Evacuate Collection Set", Level.INFO), |
|
93 |
new LogMessageWithLevel("Post Evacuate Collection Set", Level.INFO), |
|
94 |
new LogMessageWithLevel("Other", Level.INFO), |
|
95 |
||
33204
b8a3901ac5b3
8069330: Adjustment of concurrent refinement thresholds does not take hot card cache into account
tschatzl
parents:
30604
diff
changeset
|
96 |
// Update RS |
46571
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
97 |
new LogMessageWithLevel("Update RS", Level.DEBUG), |
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
98 |
new LogMessageWithLevel("Processed Buffers", Level.DEBUG), |
46778
f504c6f2eea5
8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents:
46670
diff
changeset
|
99 |
new LogMessageWithLevel("Scanned Cards", Level.DEBUG), |
f504c6f2eea5
8183121: Add information about scanned and skipped cards during UpdateRS
tschatzl
parents:
46670
diff
changeset
|
100 |
new LogMessageWithLevel("Skipped Cards", Level.DEBUG), |
36374 | 101 |
new LogMessageWithLevel("Scan HCC", Level.TRACE), |
46571
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
102 |
// Scan RS |
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
103 |
new LogMessageWithLevel("Scan RS", Level.DEBUG), |
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
104 |
new LogMessageWithLevel("Scanned Cards", Level.DEBUG), |
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
105 |
new LogMessageWithLevel("Claimed Cards", Level.DEBUG), |
c70b36f0730d
8178148: Log more detailed information about scan rs phase
tschatzl
parents:
46456
diff
changeset
|
106 |
new LogMessageWithLevel("Skipped Cards", Level.DEBUG), |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
107 |
// Ext Root Scan |
36374 | 108 |
new LogMessageWithLevel("Thread Roots", Level.TRACE), |
109 |
new LogMessageWithLevel("StringTable Roots", Level.TRACE), |
|
110 |
new LogMessageWithLevel("Universe Roots", Level.TRACE), |
|
111 |
new LogMessageWithLevel("JNI Handles Roots", Level.TRACE), |
|
112 |
new LogMessageWithLevel("ObjectSynchronizer Roots", Level.TRACE), |
|
113 |
new LogMessageWithLevel("FlatProfiler Roots", Level.TRACE), |
|
114 |
new LogMessageWithLevel("Management Roots", Level.TRACE), |
|
115 |
new LogMessageWithLevel("SystemDictionary Roots", Level.TRACE), |
|
116 |
new LogMessageWithLevel("CLDG Roots", Level.TRACE), |
|
117 |
new LogMessageWithLevel("JVMTI Roots", Level.TRACE), |
|
118 |
new LogMessageWithLevel("SATB Filtering", Level.TRACE), |
|
119 |
new LogMessageWithLevel("CM RefProcessor Roots", Level.TRACE), |
|
120 |
new LogMessageWithLevel("Wait For Strong CLD", Level.TRACE), |
|
121 |
new LogMessageWithLevel("Weak CLD Roots", Level.TRACE), |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
122 |
// Redirty Cards |
35061 | 123 |
new LogMessageWithLevel("Redirty Cards", Level.DEBUG), |
36374 | 124 |
new LogMessageWithLevel("Parallel Redirty", Level.TRACE), |
125 |
new LogMessageWithLevel("Redirtied Cards", Level.TRACE), |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
126 |
// Misc Top-level |
36374 | 127 |
new LogMessageWithLevel("Code Roots Purge", Level.DEBUG), |
42557 | 128 |
new LogMessageWithLevel("String Dedup Fixup", Level.DEBUG), |
129 |
new LogMessageWithLevel("Expand Heap After Collection", Level.DEBUG), |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
130 |
// Free CSet |
42557 | 131 |
new LogMessageWithLevel("Free Collection Set", Level.DEBUG), |
132 |
new LogMessageWithLevel("Free Collection Set Serial", Level.TRACE), |
|
133 |
new LogMessageWithLevel("Young Free Collection Set", Level.TRACE), |
|
134 |
new LogMessageWithLevel("Non-Young Free Collection Set", Level.TRACE), |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
135 |
// Humongous Eager Reclaim |
35061 | 136 |
new LogMessageWithLevel("Humongous Reclaim", Level.DEBUG), |
137 |
new LogMessageWithLevel("Humongous Register", Level.DEBUG), |
|
36367
313c87c050f7
8076463: Add logging for the preserve CM referents task
tschatzl
parents:
35061
diff
changeset
|
138 |
// Preserve CM Referents |
313c87c050f7
8076463: Add logging for the preserve CM referents task
tschatzl
parents:
35061
diff
changeset
|
139 |
new LogMessageWithLevel("Preserve CM Refs", Level.DEBUG), |
36368
569d6e8072a9
8150630: Add logging for ParScanThreadState merge phase
tschatzl
parents:
36367
diff
changeset
|
140 |
// Merge PSS |
42557 | 141 |
new LogMessageWithLevel("Merge Per-Thread State", Level.DEBUG), |
46330
40e2718fac10
8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents:
42557
diff
changeset
|
142 |
// TLAB handling |
40e2718fac10
8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents:
42557
diff
changeset
|
143 |
new LogMessageWithLevel("Prepare TLABs", Level.DEBUG), |
40e2718fac10
8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents:
42557
diff
changeset
|
144 |
new LogMessageWithLevel("Resize TLABs", Level.DEBUG), |
40e2718fac10
8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents:
42557
diff
changeset
|
145 |
|
46358
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
146 |
new LogMessageWithLevelC2OrJVMCIOnly("DerivedPointerTable Update", Level.DEBUG), |
46330
40e2718fac10
8155094: Add logging for long lasting methods found in JDK-8152948
tschatzl
parents:
42557
diff
changeset
|
147 |
new LogMessageWithLevel("Start New Collection Set", Level.DEBUG), |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
148 |
}; |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
149 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
150 |
void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
151 |
for (LogMessageWithLevel l : messages) { |
46358
10e532e20c7d
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
tschatzl
parents:
46330
diff
changeset
|
152 |
if (level.lessThan(l.level) || !l.isAvailable()) { |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
153 |
output.shouldNotContain(l.message); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
154 |
} else { |
36374 | 155 |
output.shouldMatch("\\[" + l.level + ".*" + l.message); |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
156 |
} |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
157 |
} |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
158 |
} |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
159 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
160 |
public static void main(String[] args) throws Exception { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
161 |
new TestGCLogMessages().testNormalLogs(); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
162 |
new TestGCLogMessages().testWithToSpaceExhaustionLogs(); |
42048
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
163 |
new TestGCLogMessages().testWithInitialMark(); |
46456
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
164 |
new TestGCLogMessages().testExpandHeap(); |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
165 |
} |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
166 |
|
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
167 |
private void testNormalLogs() throws Exception { |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
168 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
169 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
170 |
"-Xmx10M", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
171 |
GCTest.class.getName()); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
172 |
|
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
173 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
174 |
checkMessagesAtLevel(output, allLogMessages, Level.OFF); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
175 |
output.shouldHaveExitValue(0); |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
176 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
177 |
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
178 |
"-XX:+UseStringDeduplication", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
179 |
"-Xmx10M", |
35061 | 180 |
"-Xlog:gc+phases=debug", |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
181 |
GCTest.class.getName()); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
182 |
|
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
183 |
output = new OutputAnalyzer(pb.start()); |
35061 | 184 |
checkMessagesAtLevel(output, allLogMessages, Level.DEBUG); |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
185 |
|
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
186 |
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
187 |
"-XX:+UseStringDeduplication", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
188 |
"-Xmx10M", |
35061 | 189 |
"-Xlog:gc+phases=trace", |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
190 |
GCTest.class.getName()); |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
23454
diff
changeset
|
191 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
192 |
output = new OutputAnalyzer(pb.start()); |
35061 | 193 |
checkMessagesAtLevel(output, allLogMessages, Level.TRACE); |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
194 |
output.shouldHaveExitValue(0); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
195 |
} |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
23454
diff
changeset
|
196 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
197 |
LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] { |
35061 | 198 |
new LogMessageWithLevel("Evacuation Failure", Level.DEBUG), |
199 |
new LogMessageWithLevel("Recalculate Used", Level.TRACE), |
|
200 |
new LogMessageWithLevel("Remove Self Forwards", Level.TRACE), |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
201 |
}; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
202 |
|
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
203 |
private void testWithToSpaceExhaustionLogs() throws Exception { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
204 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
205 |
"-Xmx32M", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
206 |
"-Xmn16M", |
35061 | 207 |
"-Xlog:gc+phases=debug", |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
208 |
GCTestWithToSpaceExhaustion.class.getName()); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
209 |
|
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
210 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
35061 | 211 |
checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG); |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
212 |
output.shouldHaveExitValue(0); |
23453
09cfb0164acf
8027295: Free CSet takes ~50% of young pause time
tschatzl
parents:
23451
diff
changeset
|
213 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
214 |
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
215 |
"-Xmx32M", |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
216 |
"-Xmn16M", |
35061 | 217 |
"-Xlog:gc+phases=trace", |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
218 |
GCTestWithToSpaceExhaustion.class.getName()); |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
23454
diff
changeset
|
219 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
220 |
output = new OutputAnalyzer(pb.start()); |
35061 | 221 |
checkMessagesAtLevel(output, exhFailureMessages, Level.TRACE); |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
222 |
output.shouldHaveExitValue(0); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
223 |
} |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
224 |
|
42048
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
225 |
private void testWithInitialMark() throws Exception { |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
226 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
227 |
"-Xmx10M", |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
228 |
"-Xbootclasspath/a:.", |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
229 |
"-Xlog:gc*=debug", |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
230 |
"-XX:+UnlockDiagnosticVMOptions", |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
231 |
"-XX:+WhiteBoxAPI", |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
232 |
GCTestWithInitialMark.class.getName()); |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
233 |
|
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
234 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
235 |
output.shouldContain("Clear Claimed Marks"); |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
236 |
output.shouldHaveExitValue(0); |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
237 |
} |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
238 |
|
46456
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
239 |
private void testExpandHeap() throws Exception { |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
240 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
241 |
"-Xmx10M", |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
242 |
"-Xbootclasspath/a:.", |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
243 |
"-Xlog:gc+ergo+heap=debug", |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
244 |
"-XX:+UnlockDiagnosticVMOptions", |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
245 |
"-XX:+WhiteBoxAPI", |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
246 |
GCTest.class.getName()); |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
247 |
|
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
248 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
249 |
output.shouldContain("Expand the heap. requested expansion amount: "); |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
250 |
output.shouldContain("B expansion amount: "); |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
251 |
output.shouldHaveExitValue(0); |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
252 |
} |
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
253 |
|
9c1f0551e0a2
8166191: Missing spaces in log message during heap expansion
tschatzl
parents:
46358
diff
changeset
|
254 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
255 |
static class GCTest { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
256 |
private static byte[] garbage; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
257 |
public static void main(String [] args) { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
258 |
System.out.println("Creating garbage"); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
259 |
// create 128MB of garbage. This should result in at least one GC |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
260 |
for (int i = 0; i < 1024; i++) { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
261 |
garbage = new byte[128 * 1024]; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
262 |
} |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
263 |
System.out.println("Done"); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
264 |
} |
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
265 |
} |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
23454
diff
changeset
|
266 |
|
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
267 |
static class GCTestWithToSpaceExhaustion { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
268 |
private static byte[] garbage; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
269 |
private static byte[] largeObject; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
270 |
public static void main(String [] args) { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
271 |
largeObject = new byte[16*1024*1024]; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
272 |
System.out.println("Creating garbage"); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
273 |
// create 128MB of garbage. This should result in at least one GC, |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
274 |
// some of them with to-space exhaustion. |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
275 |
for (int i = 0; i < 1024; i++) { |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
276 |
garbage = new byte[128 * 1024]; |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
277 |
} |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
278 |
System.out.println("Done"); |
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
279 |
} |
23455
e541bff96524
8035654: Add times for evacuation failure handling in "Other" time
tschatzl
parents:
23454
diff
changeset
|
280 |
} |
42048
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
281 |
|
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
282 |
static class GCTestWithInitialMark { |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
283 |
public static void main(String [] args) { |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
284 |
sun.hotspot.WhiteBox WB = sun.hotspot.WhiteBox.getWhiteBox(); |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
285 |
WB.g1StartConcMarkCycle(); |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
286 |
} |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
287 |
} |
c1f066b53dd7
8160055: Misplaced call to ClassLoaderDataGraph::clear_claimed_marks during initial mark
jprovino
parents:
40886
diff
changeset
|
288 |
|
23451
ed2b8bb28fed
8035406: Improve data structure for Code Cache remembered sets
tschatzl
parents:
diff
changeset
|
289 |
} |
29694
442c3305ba39
8027962: Per-phase timing measurements for strong roots processing
brutisso
parents:
28497
diff
changeset
|
290 |