< prev index next >
src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
Print this page
rev 8125 : imported patch fix
rev 8127 : [mq]: inc4
@@ -218,11 +218,10 @@
HeapRegionSet _old_set;
// It keeps track of the humongous regions.
HeapRegionSet _humongous_set;
- void clear_humongous_is_live_table();
void eagerly_reclaim_humongous_regions();
// The number of regions we could create by expansion.
uint _expansion_regions;
@@ -288,26 +287,32 @@
void abandon_gc_alloc_regions();
// Helper for monitoring and management support.
G1MonitoringSupport* _g1mm;
- // Records whether the region at the given index is kept live by roots or
- // references from the young generation.
- class HumongousIsLiveBiasedMappedArray : public G1BiasedMappedArray<bool> {
+ // Records whether the region at the given index is (still) a
+ // candidate for eager reclaim. Only valid for humongous start
+ // regions; other regions have unspecified values. Initialized at
+ // start of collection pause, with candidates removed as they are
+ // found reachable from roots or the young generation.
+ class HumongousReclaimCandidates : public G1BiasedMappedArray<bool> {
protected:
bool default_value() const { return false; }
public:
void clear() { G1BiasedMappedArray<bool>::clear(); }
- void set_live(uint region) {
+ void add_candidate(uint region) {
set_by_index(region, true);
}
- bool is_live(uint region) {
+ void remove_candidate(uint region) {
+ set_by_index(region, false);
+ }
+ bool is_candidate(uint region) {
return get_by_index(region);
}
};
- HumongousIsLiveBiasedMappedArray _humongous_is_live;
+ HumongousReclaimCandidates _humongous_reclaim_candidates;
// Stores whether during humongous object registration we found candidate regions.
// If not, we can skip a few steps.
bool _has_humongous_reclaim_candidates;
volatile unsigned _gc_time_stamp;
@@ -641,22 +646,20 @@
// Do anything common to GC's.
void gc_prologue(bool full);
void gc_epilogue(bool full);
- inline void set_humongous_is_live(oop obj);
+ // Modify the reclaim candidate set and test for presence.
+ // These are only valid for starts_humongous regions.
+ inline void add_humongous_reclaim_candidate(uint region);
+ inline void remove_humongous_reclaim_candidate(uint region);
+ inline bool is_humongous_reclaim_candidate(uint region);
- bool humongous_is_live(uint region) {
- return _humongous_is_live.is_live(region);
- }
+ // Remove from the reclaim candidate set. Also remove from the
+ // collection set so that later encounters avoid the slow path.
+ inline void set_humongous_is_live(oop obj);
- // Returns whether the given region (which must be a humongous (start) region)
- // is to be considered conservatively live regardless of any other conditions.
- bool humongous_region_is_always_live(uint index);
- // Returns whether the given region (which must be a humongous (start) region)
- // is considered a candidate for eager reclamation.
- bool humongous_region_is_candidate(uint index);
// Register the given region to be part of the collection set.
inline void register_humongous_region_with_cset(uint index);
// Register regions with humongous objects (actually on the start region) in
// the in_cset_fast_test table.
void register_humongous_regions_with_cset();
< prev index next >