publicclass SharedStrings { publicstaticvoid main(String[] args) throws Exception { // Note: This is a basic sanity test for Shared Strings feature. // This also serves as a reference on how to use this feature, // hence the command lines are spelled out instead of using the // test utils methods.
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedStrings.jsa", "-Xlog:cds,cds+hashtables", // Needed for bootclasspath match, for CDS to work with WhiteBox API "-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"), "-Xshare:dump");
OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "dump");
CDSTestUtils.checkDump(out, "Shared string table stats");
pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./SharedStrings.jsa", // needed for access to white box test API "-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"), "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xshare:on", "-showversion", "SharedStringsWb");
out = CDSTestUtils.executeAndLog(pb, "exec");
CDSTestUtils.checkExec(out);
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-10-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.