--- old/src/hotspot/share/memory/filemap.cpp 2019-07-22 11:12:42.671453917 -0700 +++ new/src/hotspot/share/memory/filemap.cpp 2019-07-22 11:12:42.356424086 -0700 @@ -1610,7 +1610,9 @@ } init_from_file(_fd, is_static); - if (!validate_header(is_static)) { + // UseSharedSpaces could be disabled if the checking of some of the header fields in + // init_from_file has failed. + if (!UseSharedSpaces || !validate_header(is_static)) { return false; } return true;