changeset 8849:f942792721fa

8133553: Running with -XX:+UseParallelGC -XX:OldSize=30k crashes jvm Reviewed-by: jwilhelm, sjohanss
author david
date Mon, 17 Aug 2015 10:43:11 +0200
parents 7243608383b7
children 7a16c384cf23
files src/share/vm/gc/shared/collectorPolicy.cpp src/share/vm/gc/shared/collectorPolicy.hpp
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/shared/collectorPolicy.cpp	Mon Jun 29 11:11:12 2015 +0200
+++ b/src/share/vm/gc/shared/collectorPolicy.cpp	Mon Aug 17 10:43:11 2015 +0200
@@ -225,6 +225,10 @@
   return align_size_up(3 * _space_alignment, _gen_alignment);
 }
 
+size_t GenCollectorPolicy::old_gen_size_lower_bound() {
+  return align_size_up(_space_alignment, _gen_alignment);
+}
+
 #ifdef ASSERT
 void GenCollectorPolicy::assert_flags() {
   CollectorPolicy::assert_flags();
@@ -284,7 +288,7 @@
 
   // Make sure the heap is large enough for two generations
   size_t smallest_new_size = young_gen_size_lower_bound();
-  size_t smallest_heap_size = align_size_up(smallest_new_size + align_size_up(_space_alignment, _gen_alignment),
+  size_t smallest_heap_size = align_size_up(smallest_new_size + old_gen_size_lower_bound(),
                                            _heap_alignment);
   if (MaxHeapSize < smallest_heap_size) {
     FLAG_SET_ERGO(size_t, MaxHeapSize, smallest_heap_size);
@@ -356,6 +360,7 @@
     vm_exit_during_initialization("Invalid young gen ratio specified");
   }
 
+  OldSize = MAX2(OldSize, old_gen_size_lower_bound());
   if (!is_size_aligned(OldSize, _gen_alignment)) {
     // Setting OldSize directly to preserve information about the possible
     // setting of OldSize on the command line.
--- a/src/share/vm/gc/shared/collectorPolicy.hpp	Mon Jun 29 11:11:12 2015 +0200
+++ b/src/share/vm/gc/shared/collectorPolicy.hpp	Mon Aug 17 10:43:11 2015 +0200
@@ -282,6 +282,8 @@
 
   size_t young_gen_size_lower_bound();
 
+  size_t old_gen_size_lower_bound();
+
   HeapWord* mem_allocate_work(size_t size,
                               bool is_tlab,
                               bool* gc_overhead_limit_was_exceeded);