# HG changeset patch # User coleenp # Date 1383243062 14400 # Node ID 067dd79671286b07558f7b6c85f1e0f54738edcd # Parent cf4ca6e73f1ce01c6aaa74ea27078c0114d4ad08 8027616: Off by one error in putback for compressed oops nashorn performance improvement Summary: Should compare bounds greater than or equal 4G when deciding if shift is needed or CDS area + compressed class space are within 4G of each other. Reviewed-by: stefank, hseigel, zgu diff -r cf4ca6e73f1c -r 067dd7967128 hotspot/src/share/vm/memory/metaspace.cpp --- a/hotspot/src/share/vm/memory/metaspace.cpp Wed Oct 30 09:26:44 2013 -0700 +++ b/hotspot/src/share/vm/memory/metaspace.cpp Thu Oct 31 14:11:02 2013 -0400 @@ -2869,7 +2869,7 @@ Universe::set_narrow_klass_base(lower_base); - if ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax) { + if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) { Universe::set_narrow_klass_shift(0); } else { assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces"); @@ -2885,7 +2885,7 @@ address lower_base = MIN2((address)metaspace_base, cds_base); address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), (address)(metaspace_base + compressed_class_space_size())); - return ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax); + return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax); } // Try to allocate the metaspace at the requested addr.