< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicSharedSymbols.java

Print this page

 73                              "-Xlog:cds,cds+dynamic=info",
 74                              "-cp", appJar);
 75         long pid = theApp.getPid();
 76         LingeredApp.stopApp(theApp);
 77 
 78         // Run with dynamic archive.
 79         String sharedArchiveArg = "-XX:SharedArchiveFile=" + topArchiveName;
 80         theApp = new JCmdTestLingeredApp();
 81         LingeredApp.startApp(theApp,
 82                              "-Xshare:on", sharedArchiveArg,
 83                              "-Xlog:cds,class+load",
 84                              "-cp", appJar);
 85         pid = theApp.getPid();
 86 
 87 
 88         // Use jcmd to dump the symbols of the above process running
 89         // with dynamic shared archive.
 90         ProcessBuilder pb = new ProcessBuilder();
 91         pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), Long.toString(pid), "VM.symboltable", "-verbose"});
 92         OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-symboltable");
 93         output.shouldContain("17 2: jdk/test/lib/apps\n");

 94         output.shouldContain("Dynamic shared symbols:\n");
 95         output.shouldContain("5 65535: Hello\n");
 96 
 97         LingeredApp.stopApp(theApp);
 98     }
 99 }

 73                              "-Xlog:cds,cds+dynamic=info",
 74                              "-cp", appJar);
 75         long pid = theApp.getPid();
 76         LingeredApp.stopApp(theApp);
 77 
 78         // Run with dynamic archive.
 79         String sharedArchiveArg = "-XX:SharedArchiveFile=" + topArchiveName;
 80         theApp = new JCmdTestLingeredApp();
 81         LingeredApp.startApp(theApp,
 82                              "-Xshare:on", sharedArchiveArg,
 83                              "-Xlog:cds,class+load",
 84                              "-cp", appJar);
 85         pid = theApp.getPid();
 86 
 87 
 88         // Use jcmd to dump the symbols of the above process running
 89         // with dynamic shared archive.
 90         ProcessBuilder pb = new ProcessBuilder();
 91         pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), Long.toString(pid), "VM.symboltable", "-verbose"});
 92         OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-symboltable");
 93         output.shouldContain("17 3: jdk/test/lib/apps\n");  // 3 because a TempSymbol will be found in the TempSymbolCleanupDelayer queue.
 94                    // Note: we might want to drain the queue before CDS dumps but this is correct for now, unless the queue length changes.
 95         output.shouldContain("Dynamic shared symbols:\n");
 96         output.shouldContain("5 65535: Hello\n");
 97 
 98         LingeredApp.stopApp(theApp);
 99     }
100 }
< prev index next >