mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8154457: runtime/SharedArchiveFile/SharedStrings Shared string table stats missing
Added more information when print out message reporting disabling the shared strings at CDS dump time. Reviewed-by: lfoltan, hseigel, mseledtsov, gtriantafill
This commit is contained in:
parent
4ba6969ac6
commit
2d65e6174c
2 changed files with 41 additions and 23 deletions
|
@ -730,8 +730,12 @@ void StringTable::serialize(SerializeClosure* soc, GrowableArray<MemRegion> *str
|
||||||
if (soc->writing()) {
|
if (soc->writing()) {
|
||||||
if (!(UseG1GC && UseCompressedOops && UseCompressedClassPointers)) {
|
if (!(UseG1GC && UseCompressedOops && UseCompressedClassPointers)) {
|
||||||
if (PrintSharedSpaces) {
|
if (PrintSharedSpaces) {
|
||||||
tty->print_cr("Shared strings are excluded from the archive as UseG1GC, "
|
tty->print_cr(
|
||||||
"UseCompressedOops and UseCompressedClassPointers are required.");
|
"Shared strings are excluded from the archive as UseG1GC, "
|
||||||
|
"UseCompressedOops and UseCompressedClassPointers are required."
|
||||||
|
"Current settings: UseG1GC=%s, UseCompressedOops=%s, UseCompressedClassPointers=%s.",
|
||||||
|
BOOL_TO_STR(UseG1GC), BOOL_TO_STR(UseCompressedOops),
|
||||||
|
BOOL_TO_STR(UseCompressedClassPointers));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int num_buckets = the_table()->number_of_entries() /
|
int num_buckets = the_table()->number_of_entries() /
|
||||||
|
|
|
@ -40,19 +40,32 @@ import jdk.test.lib.*;
|
||||||
|
|
||||||
public class SharedStrings {
|
public class SharedStrings {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
boolean test_runtime = true;
|
||||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||||
"-XX:+UnlockDiagnosticVMOptions",
|
"-XX:+UnlockDiagnosticVMOptions",
|
||||||
"-XX:SharedArchiveFile=./SharedStrings.jsa",
|
"-XX:SharedArchiveFile=./SharedStrings.jsa",
|
||||||
|
"-XX:+UseG1GC",
|
||||||
|
"-XX:+UseCompressedOops",
|
||||||
"-XX:+PrintSharedSpaces",
|
"-XX:+PrintSharedSpaces",
|
||||||
// Needed for bootclasspath match, for CDS to work with WhiteBox API
|
// Needed for bootclasspath match, for CDS to work with WhiteBox API
|
||||||
"-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"),
|
"-Xbootclasspath/a:" + ClassFileInstaller.getJarPath("whitebox.jar"),
|
||||||
"-Xshare:dump");
|
"-Xshare:dump");
|
||||||
|
|
||||||
new OutputAnalyzer(pb.start())
|
OutputAnalyzer dumpOutput = new OutputAnalyzer(pb.start());
|
||||||
.shouldContain("Loading classes to share")
|
try {
|
||||||
.shouldContain("Shared string table stats")
|
dumpOutput.shouldContain("Loading classes to share");
|
||||||
.shouldHaveExitValue(0);
|
dumpOutput.shouldContain("Shared string table stats");
|
||||||
|
dumpOutput.shouldHaveExitValue(0);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
if (dumpOutput.getOutput().indexOf("Shared strings are excluded") != -1 ||
|
||||||
|
dumpOutput.getOutput().indexOf("Cannot dump shared archive") != -1) {
|
||||||
|
test_runtime = false;
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("Unexpected failure");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (test_runtime) {
|
||||||
pb = ProcessTools.createJavaProcessBuilder(
|
pb = ProcessTools.createJavaProcessBuilder(
|
||||||
"-XX:+UnlockDiagnosticVMOptions",
|
"-XX:+UnlockDiagnosticVMOptions",
|
||||||
"-XX:SharedArchiveFile=./SharedStrings.jsa",
|
"-XX:SharedArchiveFile=./SharedStrings.jsa",
|
||||||
|
@ -74,3 +87,4 @@ public class SharedStrings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue