changeset 8649:d51e38f88f9f

8129573: CollectedHeap::fill_with_objects() needs to use multiple arrays in 32 bit mode too Summary: In JDK-8042668 we introduced a custom fill threshold for G1. This leads to CollectedHeap::fill_with_objects create too large objects in G1 when using it in 32 bit mode, as the code to create multiple filler objects is IFDEF'ed out on 32 bit. Enable this code on 32 bit too. Reviewed-by: tonyp, mgerdin, tbenson
author tschatzl
date Thu, 25 Jun 2015 09:06:35 +0200
parents 15c67e2f7cab
children 825306677064
files src/share/vm/gc/shared/collectedHeap.cpp
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/shared/collectedHeap.cpp	Thu Jun 25 09:04:28 2015 +0200
+++ b/src/share/vm/gc/shared/collectedHeap.cpp	Thu Jun 25 09:06:35 2015 +0200
@@ -488,19 +488,17 @@
   DEBUG_ONLY(fill_args_check(start, words);)
   HandleMark hm;  // Free handles before leaving.
 
-#ifdef _LP64
-  // A single array can fill ~8G, so multiple objects are needed only in 64-bit.
-  // First fill with arrays, ensuring that any remaining space is big enough to
-  // fill.  The remainder is filled with a single object.
+  // Multiple objects may be required depending on the filler array maximum size. Fill
+  // the range up to that with objects that are filler_array_max_size sized. The
+  // remainder is filled with a single object.
   const size_t min = min_fill_size();
   const size_t max = filler_array_max_size();
   while (words > max) {
-    const size_t cur = words - max >= min ? max : max - min;
+    const size_t cur = (words - max) >= min ? max : max - min;
     fill_with_array(start, cur, zap);
     start += cur;
     words -= cur;
   }
-#endif
 
   fill_with_object_impl(start, words, zap);
 }