< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.cpp

Print this page

        

@@ -885,16 +885,26 @@
     // Fill the memory below the allocated range with dummy object(s),
     // if the region bottom does not match the range start, or if the previous
     // range ended within the same G1 region, and there is a gap.
     if (start_address != bottom_address) {
       size_t fill_size = pointer_delta(start_address, bottom_address);
-      G1CollectedHeap::fill_with_objects(bottom_address, fill_size);
+      fill_with_non_humongous_objects(bottom_address, fill_size);
       increase_used(fill_size * HeapWordSize);
     }
   }
 }
 
+void G1CollectedHeap::fill_with_non_humongous_objects(HeapWord* start, size_t words, bool zap)
+{
+  size_t prev_filler_array_max_size = _filler_array_max_size;
+  _filler_array_max_size = _humongous_object_threshold_in_words;
+
+  CollectedHeap::fill_with_objects(start, words);
+
+  _filler_array_max_size = prev_filler_array_max_size;
+}
+
 inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size,
                                                      uint* gc_count_before_ret,
                                                      uint* gclocker_retry_count_ret) {
   assert_heap_not_locked_and_not_at_safepoint();
   assert(!is_humongous(word_size), "attempt_allocation() should not "

@@ -1851,14 +1861,10 @@
   _workers->initialize_workers();
 
   _allocator = G1Allocator::create_allocator(this);
   _humongous_object_threshold_in_words = humongous_threshold_for(HeapRegion::GrainWords);
 
-  // Override the default _filler_array_max_size so that no humongous filler
-  // objects are created.
-  _filler_array_max_size = _humongous_object_threshold_in_words;
-
   uint n_queues = ParallelGCThreads;
   _task_queues = new RefToScanQueueSet(n_queues);
 
   uint n_rem_sets = HeapRegionRemSet::num_par_rem_sets();
   assert(n_rem_sets > 0, "Invariant.");
< prev index next >