# HG changeset patch # User coleenp # Date 1383243062 14400 # Node ID c8fc12209830fc5815286059510d1230cdd72c17 # Parent 4fe7815b04f594acc6ef35a70542c8ac7adbb893 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 4fe7815b04f5 -r c8fc12209830 src/share/vm/memory/metaspace.cpp --- a/src/share/vm/memory/metaspace.cpp Wed Oct 30 09:26:44 2013 -0700 +++ b/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.