--- old/src/share/vm/memory/metaspace.cpp 2017-08-08 17:40:52.716779639 -0400 +++ new/src/share/vm/memory/metaspace.cpp 2017-08-08 17:40:51.408705301 -0400 @@ -3347,8 +3347,8 @@ // If UseCompressedClassPointers is set then allocate the metaspace area // above the heap and above the CDS area (if it exists). allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address); - // Map the archived heap regions after compressed pointers - // because it relies on compressed class pointers setting to work + // map_heap_regions() compares the current narrow oop and klass encodings + // with the archived ones, so it must be done after all encodings are determined. mapinfo->map_heap_regions(); } #endif // _LP64