Skip to content

Commit

Permalink
8255990: Bitmap region of dynamic CDS archive is not unmapped
Browse files Browse the repository at this point in the history
Reviewed-by: iklam, minqi
  • Loading branch information
calvinccheung committed Nov 12, 2020
1 parent 943acd2 commit c6ab0fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/hotspot/share/memory/metaspaceShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,7 @@ void MetaspaceShared::initialize_shared_spaces() {
SymbolTable::serialize_shared_table_header(&rc, false);
SystemDictionaryShared::serialize_dictionary_headers(&rc, false);
dynamic_mapinfo->close();
dynamic_mapinfo->unmap_region(MetaspaceShared::bm);
}

if (PrintSharedArchiveAndExit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ static void doTest() throws Exception {
String topArchiveName = getNewArchiveName("top");

String runtimeMsg = "Try to map archive(s) at an alternative address";
String unmapPrefix = ".*Unmapping region #3 at base 0x.*";
String unmapPattern = unmapPrefix + "(Bitmap)";
String unlockArg = "-XX:+UnlockDiagnosticVMOptions";

// (1) Dump base archive (static)
Expand Down Expand Up @@ -121,7 +123,12 @@ static void doTest() throws Exception {
"-cp", appJar, mainClass)
.assertNormalExit(output -> {
if (run_reloc) {
output.shouldContain(runtimeMsg);
output.shouldContain(runtimeMsg)
// Check that there are two of the following lines in
// the output. One for static archive and one for
// dynamic archive:
// Unmapping region #3 at base 0x<hex digits> (Bitmap)
.shouldMatchByLine(unmapPrefix, "Hello World", unmapPattern);
}
});
}
Expand Down

0 comments on commit c6ab0fd

Please sign in to comment.