8012265: VM often crashes on solaris with a lot of memory
authorbrutisso
Fri, 14 Jun 2013 08:02:32 +0200
changeset 18090 d73d91e93e42
parent 18068 45a0e81d43b7
child 18091 ddde9f0f414d
8012265: VM often crashes on solaris with a lot of memory Summary: Increase HeapBaseMinAddress for G1 from 256m to 1g on Solaris x86 Reviewed-by: mgerdin, coleenp, kvn
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/arguments.hpp
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Fri Jun 14 07:27:22 2013 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Fri Jun 14 08:02:32 2013 +0200
@@ -1566,6 +1566,15 @@
   return result;
 }
 
+void Arguments::set_heap_base_min_address() {
+  if (FLAG_IS_DEFAULT(HeapBaseMinAddress) && UseG1GC && HeapBaseMinAddress < 1*G) {
+    // By default HeapBaseMinAddress is 2G on all platforms except Solaris x86.
+    // G1 currently needs a lot of C-heap, so on Solaris we have to give G1
+    // some extra space for the C-heap compared to other collectors.
+    FLAG_SET_ERGO(uintx, HeapBaseMinAddress, 1*G);
+  }
+}
+
 void Arguments::set_heap_size() {
   if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) {
     // Deprecated flag
@@ -3525,6 +3534,8 @@
     }
   }
 
+  set_heap_base_min_address();
+
   // Set heap size based on available physical memory
   set_heap_size();
 
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Fri Jun 14 07:27:22 2013 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Fri Jun 14 08:02:32 2013 +0200
@@ -315,6 +315,8 @@
   // limits the given memory size by the maximum amount of memory this process is
   // currently allowed to allocate or reserve.
   static julong limit_by_allocatable_memory(julong size);
+  // Setup HeapBaseMinAddress
+  static void set_heap_base_min_address();
   // Setup heap size
   static void set_heap_size();
   // Based on automatic selection criteria, should the