8072434: 8064457: introduces performance regressions in 9-b47
authorgoetz
Wed, 04 Feb 2015 16:26:38 +0100
changeset 28946 24261e03ba4c
parent 28945 c96ebbd7b8b6
child 28947 2ea471384931
8072434: 8064457: introduces performance regressions in 9-b47 Reviewed-by: coleenp, kvn
hotspot/src/share/vm/runtime/virtualspace.cpp
--- a/hotspot/src/share/vm/runtime/virtualspace.cpp	Thu Feb 05 12:54:34 2015 +0100
+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp	Wed Feb 04 16:26:38 2015 +0100
@@ -503,11 +503,12 @@
     // But leave room for the compressed class pointers, which is allocated above
     // the heap.
     char *zerobased_max = (char *)OopEncodingHeapMax;
+    const size_t class_space = align_size_up(CompressedClassSpaceSize, alignment);
     // For small heaps, save some space for compressed class pointer
     // space so it can be decoded with no base.
     if (UseCompressedClassPointers && !UseSharedSpaces &&
-        OopEncodingHeapMax <= KlassEncodingMetaspaceMax) {
-      const size_t class_space = align_size_up(CompressedClassSpaceSize, alignment);
+        OopEncodingHeapMax <= KlassEncodingMetaspaceMax &&
+        (uint64_t)(aligned_heap_base_min_address + size + class_space) <= KlassEncodingMetaspaceMax) {
       zerobased_max = (char *)OopEncodingHeapMax - class_space;
     }