From a7b26564cafc8b343e73b76a713a7ad984f75f9f Mon Sep 17 00:00:00 2001 From: kvn Date: Tue, 14 Sep 2010 17:19:35 -0700 Subject: [PATCH] 6984368: Large default heap size does not allow to use zero based compressed oops Summary: take into account HeapBaseMinAddress and round down MaxPermSize Reviewed-by: never --- src/share/vm/memory/collectorPolicy.cpp | 6 +++++- src/share/vm/runtime/arguments.cpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/share/vm/memory/collectorPolicy.cpp b/src/share/vm/memory/collectorPolicy.cpp index b8e4ab35d..c6b8e3875 100644 --- a/src/share/vm/memory/collectorPolicy.cpp +++ b/src/share/vm/memory/collectorPolicy.cpp @@ -32,7 +32,11 @@ void CollectorPolicy::initialize_flags() { MaxPermSize = PermSize; } PermSize = MAX2(min_alignment(), align_size_down_(PermSize, min_alignment())); - MaxPermSize = align_size_up(MaxPermSize, max_alignment()); + // Don't increase Perm size limit above specified. + MaxPermSize = align_size_down(MaxPermSize, max_alignment()); + if (PermSize > MaxPermSize) { + PermSize = MaxPermSize; + } MinPermHeapExpansion = MAX2(min_alignment(), align_size_down_(MinPermHeapExpansion, min_alignment())); MaxPermHeapExpansion = MAX2(min_alignment(), align_size_down_(MaxPermHeapExpansion, min_alignment())); diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index b70be1b73..ec7210870 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1273,7 +1273,8 @@ bool verify_object_alignment() { } inline uintx max_heap_for_compressed_oops() { - LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); + // Heap should be above HeapBaseMinAddress to get zero based compressed oops. + LP64_ONLY(return OopEncodingHeapMax - MaxPermSize - os::vm_page_size() - HeapBaseMinAddress); NOT_LP64(ShouldNotReachHere(); return 0); } -- GitLab