26 * @test |
26 * @test |
27 * @summary Test how CDS dumping handles the existence of humongous G1 regions. |
27 * @summary Test how CDS dumping handles the existence of humongous G1 regions. |
28 * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes |
28 * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes |
29 * @requires vm.cds.archived.java.heap |
29 * @requires vm.cds.archived.java.heap |
30 * @requires vm.flavor != "minimal" |
30 * @requires vm.flavor != "minimal" |
31 * @build HumongousDuringDumpTransformer Hello |
31 * @run driver/timeout=240 HumongousDuringDump |
32 * @run main/othervm/timeout=240 HumongousDuringDump |
|
33 */ |
32 */ |
34 |
33 |
35 import jdk.test.lib.cds.CDSOptions; |
34 import jdk.test.lib.cds.CDSOptions; |
36 import jdk.test.lib.process.OutputAnalyzer; |
35 import jdk.test.lib.process.OutputAnalyzer; |
37 import jdk.test.lib.process.ProcessTools; |
36 import jdk.test.lib.process.ProcessTools; |
38 |
37 |
39 public class HumongousDuringDump { |
38 public class HumongousDuringDump { |
40 public static String appClasses[] = { |
39 public static String appClasses[] = { |
41 "Hello", |
40 Hello.class.getName(), |
42 }; |
41 }; |
43 public static String agentClasses[] = { |
42 public static String agentClasses[] = { |
44 "HumongousDuringDumpTransformer", |
43 HumongousDuringDumpTransformer.class.getName(), |
45 }; |
44 }; |
46 |
45 |
47 public static void main(String[] args) throws Throwable { |
46 public static void main(String[] args) throws Throwable { |
48 String agentJar = |
47 String agentJar = |
49 ClassFileInstaller.writeJar("HumongousDuringDumpTransformer.jar", |
48 ClassFileInstaller.writeJar("HumongousDuringDumpTransformer.jar", |
58 |
57 |
59 String extraArg = "-javaagent:" + agentJar; |
58 String extraArg = "-javaagent:" + agentJar; |
60 String extraOption = "-XX:+AllowArchivingWithJavaAgent"; |
59 String extraOption = "-XX:+AllowArchivingWithJavaAgent"; |
61 |
60 |
62 OutputAnalyzer out = |
61 OutputAnalyzer out = |
63 TestCommon.testDump(appJar, TestCommon.list("Hello"), |
62 TestCommon.testDump(appJar, TestCommon.list(Hello.class.getName()), |
64 "-XX:+UnlockDiagnosticVMOptions", extraOption, |
63 "-XX:+UnlockDiagnosticVMOptions", extraOption, |
65 "-Xlog:gc+region+cds", |
64 "-Xlog:gc+region+cds", |
66 "-Xlog:gc+region=trace", |
65 "-Xlog:gc+region=trace", |
67 extraArg, "-Xmx64m", gcLog); |
66 extraArg, "-Xmx64m", gcLog); |
68 out.shouldContain("(Unmovable) humongous regions have been found and may lead to fragmentation"); |
67 out.shouldContain("(Unmovable) humongous regions have been found and may lead to fragmentation"); |