src/share/vm/runtime/arguments.cpp

Print this page
rev 6667 : 8048088: Conservative maximum heap alignment should take vm_allocation_granularity into account
Summary: The conservative max heap alignment does not take the alignment requirement imposed by the OS into account when calculating it. This may cause some assertions to fail, although it does not do at the moment because that alignment is always smaller than other alignments for the heap.
Reviewed-by:

@@ -1549,11 +1549,13 @@
     heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
   } else if (UseG1GC) {
     heap_alignment = G1CollectedHeap::conservative_max_heap_alignment();
   }
 #endif // INCLUDE_ALL_GCS
-  _conservative_max_heap_alignment = MAX3(heap_alignment, os::max_page_size(),
+  _conservative_max_heap_alignment = MAX4(heap_alignment,
+                                          (size_t)os::vm_allocation_granularity(),
+                                          os::max_page_size(),
     CollectorPolicy::compute_heap_alignment());
 }
 
 void Arguments::set_ergonomics_flags() {