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

Print this page
rev 6673 : 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 6674 : imported patch fixes-kim

*** 1156,1178 **** virtual bool is_maximal_no_gc() const { return _g1_storage.uncommitted_size() == 0; } // The total number of regions in the heap. ! uint n_regions() { return _hrs.length(); } // The max number of regions in the heap. ! uint max_regions() { return _hrs.max_length(); } // The number of regions that are completely free. ! uint free_regions() { return _free_list.length(); } // The number of regions that are not completely free. ! uint used_regions() { return n_regions() - free_regions(); } // The number of regions available for "regular" expansion. ! uint expansion_regions() { return _expansion_regions; } // Factory method for HeapRegion instances. It will return NULL if // the allocation fails. HeapRegion* new_heap_region(uint hrs_index, HeapWord* bottom); --- 1156,1178 ---- virtual bool is_maximal_no_gc() const { return _g1_storage.uncommitted_size() == 0; } // The total number of regions in the heap. ! uint n_regions() const { return _hrs.length(); } // The max number of regions in the heap. ! uint max_regions() const { return _hrs.max_length(); } // The number of regions that are completely free. ! uint free_regions() const { return _free_list.length(); } // The number of regions that are not completely free. ! uint used_regions() const { return n_regions() - free_regions(); } // The number of regions available for "regular" expansion. ! uint expansion_regions() const { return _expansion_regions; } // Factory method for HeapRegion instances. It will return NULL if // the allocation fails. HeapRegion* new_heap_region(uint hrs_index, HeapWord* bottom);
*** 1390,1401 **** void collection_set_iterate(HeapRegionClosure* blk); // As above but starting from region r void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk); ! // Returns the first (lowest address) compactible space in the heap. ! virtual CompactibleSpace* first_compactible_space(); // A CollectedHeap will contain some number of spaces. This finds the // space containing a given address, or else returns NULL. virtual Space* space_containing(const void* addr) const; --- 1390,1400 ---- void collection_set_iterate(HeapRegionClosure* blk); // As above but starting from region r void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk); ! HeapRegion* next_compaction_region(const HeapRegion* from) const; // A CollectedHeap will contain some number of spaces. This finds the // space containing a given address, or else returns NULL. virtual Space* space_containing(const void* addr) const;