--- old/src/hotspot/share/memory/filemap.cpp 2020-06-08 16:46:10.513948899 -0700 +++ new/src/hotspot/share/memory/filemap.cpp 2020-06-08 16:46:10.213937606 -0700 @@ -217,6 +217,7 @@ _compressed_class_ptrs = UseCompressedClassPointers; _max_heap_size = MaxHeapSize; _narrow_klass_shift = CompressedKlassPointers::shift(); + _use_optimized_module_handling = MetaspaceShared::use_optimized_module_handling(); // The following fields are for sanity checks for whether this archive // will function correctly with this JVM and the bootclasspath it's @@ -2140,6 +2141,11 @@ return false; } + if (!_use_optimized_module_handling) { + MetaspaceShared::disable_optimized_module_handling(); + log_info(cds)("use_optimized_module_handling disabled: archive was created without optimized module handling"); + } + return true; }