changeset 1975:4cf84525dc4d

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
author kvn
date Tue, 14 Sep 2010 17:19:35 -0700
parents cff4ddf257b4
children f6b107f3629a
files src/share/vm/memory/collectorPolicy.cpp src/share/vm/runtime/arguments.cpp
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/memory/collectorPolicy.cpp	Mon Sep 13 16:45:00 2010 -0700
+++ b/src/share/vm/memory/collectorPolicy.cpp	Tue Sep 14 17:19:35 2010 -0700
@@ -32,7 +32,11 @@
     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()));
--- a/src/share/vm/runtime/arguments.cpp	Mon Sep 13 16:45:00 2010 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Tue Sep 14 17:19:35 2010 -0700
@@ -1250,7 +1250,8 @@
 }
 
 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);
 }