Print this page
8236073: G1: Use SoftMaxHeapSize to guide GC heuristics

@@ -85,17 +85,21 @@
       }
     }
     if (AlwaysPreTouch) {
       _storage.pretouch(start_page, size_in_pages, pretouch_gang);
     }
-    _commit_map.set_range(start_idx, start_idx + num_regions);
+    _commit_map.par_set_range(start_idx, start_idx + num_regions, BitMap::unknown_range);
     fire_on_commit(start_idx, num_regions, zero_filled);
   }
 
   virtual void uncommit_regions(uint start_idx, size_t num_regions) {
     _storage.uncommit((size_t)start_idx * _pages_per_region, num_regions * _pages_per_region);
-    _commit_map.clear_range(start_idx, start_idx + num_regions);
+    _commit_map.par_clear_range(start_idx, start_idx + num_regions, BitMap::unknown_range);
+  }
+
+  virtual bool can_parallelly_commit_and_uncommit() const {
+    return !_storage.is_special();
   }
 };
 
 // G1RegionToSpaceMapper implementation where the region granularity is smaller
 // than the commit granularity.

@@ -180,10 +184,14 @@
       }
       _refcounts.set_by_index(idx, old_refcount - 1);
       _commit_map.clear_bit(i);
     }
   }
+
+  virtual bool can_parallelly_commit_and_uncommit() const {
+    return false;
+  }
 };
 
 void G1RegionToSpaceMapper::fire_on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
   if (_listener != NULL) {
     _listener->on_commit(start_idx, num_regions, zero_filled);

@@ -300,10 +308,14 @@
     _dram_mapper->uncommit_regions(start_idx > _start_index_of_dram ? (start_idx - _start_index_of_dram) : 0, num_dram);
     _num_committed_dram -= num_dram;
   }
 }
 
+bool G1RegionToHeteroSpaceMapper::can_parallelly_commit_and_uncommit() const {
+  return false;
+}
+
 uint G1RegionToHeteroSpaceMapper::num_committed_dram() const {
   return _num_committed_dram;
 }
 
 uint G1RegionToHeteroSpaceMapper::num_committed_nvdimm() const {