src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp

Print this page
rev 6668 : 8048112: G1 Full GC needs to support the case when the very first region is not available
Summary: To allow uncommit of regions within the heap, G1 Full GC should correctly handle the case when the very first region is not available (uncommitted). Provide support for that by lazily initializing the compaction point during iteration of the list of heap regions. Further refactor the code to let the G1CollectedHeap handle finding the next region to compact into.
Reviewed-by:
rev 6669 : 8048084: Need to abort concurrent next bitmap clear when marking is aborted during concurrent next bitmap clearing
Summary: When concurrent next bitmap clearing is interrupted by Full GC, we need to abort concurrent next bitmap clear. On the one hand, the concurrent marking thread might still be working on a just uncommitted region, and on the other hand this is superfluous work because the Full GC already did that during mark abort handling.
Reviewed-by:

@@ -1334,26 +1334,26 @@
 
   // Return the region with the given index. It assumes the index is valid.
   inline HeapRegion* region_at(uint index) const;
 
   // Divide the heap region sequence into "chunks" of some size (the number
-  // of regions divided by the number of parallel threads times some
-  // overpartition factor, currently 4).  Assumes that this will be called
+  // of regions divided by the number of parallel threads).
+  // Assumes that this will be called
   // in parallel by ParallelGCThreads worker threads with distinct worker
   // ids in the range [0..max(ParallelGCThreads-1, 1)], that all parallel
   // calls will use the same "claim_value", and that that claim value is
   // different from the claim_value of any heap region before the start of
-  // the iteration.  Applies "blk->doHeapRegion" to each of the regions, by
+  // the iteration.
+  // Applies "blk->doHeapRegion" to each of the regions, by
   // attempting to claim the first region in each chunk, and, if
   // successful, applying the closure to each region in the chunk (and
   // setting the claim value of the second and subsequent regions of the
-  // chunk.)  For now requires that "doHeapRegion" always returns "false",
-  // i.e., that a closure never attempt to abort a traversal.
+  // chunk.)
   void heap_region_par_iterate_chunked(HeapRegionClosure* blk,
                                        uint worker,
                                        uint no_of_par_workers,
-                                       jint claim_value);
+                                       jint claim_value) const;
 
   // It resets all the region claim values to the default.
   void reset_heap_region_claim_values();
 
   // Resets the claim values of regions in the current

@@ -1374,14 +1374,14 @@
 
   // Given the id of a worker, obtain or calculate a suitable
   // starting region for iterating over the current collection set.
   HeapRegion* start_cset_region_for_worker(uint worker_i);
 
-  // This is a convenience method that is used by the
-  // HeapRegionIterator classes to calculate the starting region for
-  // each worker so that they do not all start from the same region.
-  HeapRegion* start_region_for_worker(uint worker_i, uint no_of_par_workers);
+  // This is a convenience method that is used by the to calculate the starting
+  // region index for each worker so that they do not all start from the same
+  // region.
+  uint start_region_for_worker(uint worker_i, uint num_workers, uint num_regions) const;
 
   // Iterate over the regions (if any) in the current collection set.
   void collection_set_iterate(HeapRegionClosure* blk);
 
   // As above but starting from region r