8072434: 8064457: introduces performance regressions in 9-b47
Reviewed-by: coleenp, kvn
--- 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;
}