Skip to content

Commit 745f7e7

Browse files
committed
8281186: runtime/cds/appcds/DumpingWithNoCoops.java fails
Reviewed-by: minqi, iklam, stuefe
1 parent 1870465 commit 745f7e7

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

test/hotspot/jtreg/runtime/cds/appcds/DumpingWithNoCoops.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,25 @@ String heapArgsString(HeapArgs ha) {
7272
// all sizes are in the unit of GB
7373
// size of 0 means don't set the heap size
7474
new HeapArgs( 0, 0, 0),
75-
new HeapArgs( 8, 0, 0),
76-
new HeapArgs( 0, 8, 0),
77-
new HeapArgs( 0, 0, 8),
78-
new HeapArgs( 8, 8, 0),
79-
new HeapArgs( 0, 8, 8),
80-
new HeapArgs( 8, 0, 8),
81-
new HeapArgs( 8, 8, 8),
75+
new HeapArgs( 5, 3, 5),
76+
new HeapArgs( 3, 3, 5),
77+
new HeapArgs( 5, 5, 5),
8278
new HeapArgs( 2, 1, 33),
8379
};
8480

81+
static void checkExpectedMessages(HeapArgs ha, OutputAnalyzer output) throws Exception {
82+
final int DUMPTIME_MAX_HEAP = 4; // 4 GB
83+
if (ha.minSize > DUMPTIME_MAX_HEAP) {
84+
output.shouldContain("Setting MinHeapSize to 4G for CDS dumping");
85+
}
86+
if (ha.initialSize > DUMPTIME_MAX_HEAP) {
87+
output.shouldContain("Setting InitialHeapSize to 4G for CDS dumping");
88+
}
89+
if (ha.maxSize > DUMPTIME_MAX_HEAP) {
90+
output.shouldContain("Setting MaxHeapSize to 4G for CDS dumping");
91+
}
92+
}
93+
8594
public static void main(String[] args) throws Exception {
8695
final String noCoops = "-XX:-UseCompressedOops";
8796
final String logArg = "-Xlog:gc+heap=trace,cds=debug";
@@ -108,10 +117,10 @@ public static void main(String[] args) throws Exception {
108117
dumptimeArgs.add(heapSize);
109118
}
110119
output = TestCommon.dump(appJar, appClasses, dumptimeArgs.toArray(new String[0]));
111-
output.shouldContain("Setting MaxHeapSize to 4G for CDS dumping");
120+
checkExpectedMessages(ha, output);
112121
}
113-
TestCommon.checkDump(output);
114122

123+
TestCommon.checkDump(output);
115124
TestCommon.run("-cp", appJar,
116125
logArg, "-Xlog:class+load", noCoops, "Hello")
117126
.assertNormalExit("Hello source: shared objects file");

0 commit comments

Comments
 (0)