57 // may combine concurrent marking with parallel, incremental compaction of
58 // heap subsets that will yield large amounts of garbage.
59
60 // Forward declarations
61 class HeapRegion;
62 class HRRSCleanupTask;
63 class GenerationSpec;
64 class G1ParScanThreadState;
65 class G1ParScanThreadStateSet;
66 class G1ParScanThreadState;
67 class ObjectClosure;
68 class SpaceClosure;
69 class CompactibleSpaceClosure;
70 class Space;
71 class G1CollectionSet;
72 class G1CollectorPolicy;
73 class G1Policy;
74 class G1HotCardCache;
75 class G1RemSet;
76 class G1YoungRemSetSamplingThread;
77 class HeapRegionRemSetIterator;
78 class G1ConcurrentMark;
79 class ConcurrentMarkThread;
80 class G1ConcurrentRefine;
81 class GenerationCounters;
82 class STWGCTimer;
83 class G1NewTracer;
84 class EvacuationFailedInfo;
85 class nmethod;
86 class Ticks;
87 class WorkGang;
88 class G1Allocator;
89 class G1ArchiveAllocator;
90 class G1FullGCScope;
91 class G1HeapVerifier;
92 class G1HeapSizingPolicy;
93 class G1HeapSummary;
94 class G1EvacSummary;
95
96 typedef OverflowTaskQueue<StarTask, mtGC> RefToScanQueue;
131
132 // Closures used in implementation.
133 friend class G1ParScanThreadState;
134 friend class G1ParScanThreadStateSet;
135 friend class G1ParTask;
136 friend class G1PLABAllocator;
137 friend class G1PrepareCompactClosure;
138
139 // Other related classes.
140 friend class HeapRegionClaimer;
141
142 // Testing classes.
143 friend class G1CheckCSetFastTableClosure;
144
145 private:
146 G1YoungRemSetSamplingThread* _young_gen_sampling_thread;
147
148 WorkGang* _workers;
149 G1CollectorPolicy* _collector_policy;
150
151 static size_t _humongous_object_threshold_in_words;
152
153 // The secondary free list which contains regions that have been
154 // freed up during the cleanup process. This will be appended to
155 // the master free list when appropriate.
156 FreeRegionList _secondary_free_list;
157
158 // It keeps track of the old regions.
159 HeapRegionSet _old_set;
160
161 // It keeps track of the humongous regions.
162 HeapRegionSet _humongous_set;
163
164 void eagerly_reclaim_humongous_regions();
165 // Start a new incremental collection set for the next pause.
166 void start_new_collection_set();
167
168 // The number of regions we could create by expansion.
169 uint _expansion_regions;
170
988 return CollectedHeap::G1CollectedHeap;
989 }
990
991 virtual const char* name() const {
992 return "G1";
993 }
994
995 const G1CollectorState* collector_state() const { return &_collector_state; }
996 G1CollectorState* collector_state() { return &_collector_state; }
997
998 // The current policy object for the collector.
999 G1Policy* g1_policy() const { return _g1_policy; }
1000
1001 const G1CollectionSet* collection_set() const { return &_collection_set; }
1002 G1CollectionSet* collection_set() { return &_collection_set; }
1003
1004 virtual CollectorPolicy* collector_policy() const;
1005
1006 // Adaptive size policy. No such thing for g1.
1007 virtual AdaptiveSizePolicy* size_policy() { return NULL; }
1008
1009 // The rem set and barrier set.
1010 G1RemSet* g1_rem_set() const { return _g1_rem_set; }
1011
1012 // Try to minimize the remembered set.
1013 void scrub_rem_set();
1014
1015 uint get_gc_time_stamp() {
1016 return _gc_time_stamp;
1017 }
1018
1019 inline void reset_gc_time_stamp();
1020
1021 void check_gc_time_stamps() PRODUCT_RETURN;
1022
1023 inline void increment_gc_time_stamp();
1024
1025 // Reset the given region's GC timestamp. If it's starts humongous,
1026 // also reset the GC timestamp of its corresponding
1027 // continues humongous regions too.
|
57 // may combine concurrent marking with parallel, incremental compaction of
58 // heap subsets that will yield large amounts of garbage.
59
60 // Forward declarations
61 class HeapRegion;
62 class HRRSCleanupTask;
63 class GenerationSpec;
64 class G1ParScanThreadState;
65 class G1ParScanThreadStateSet;
66 class G1ParScanThreadState;
67 class ObjectClosure;
68 class SpaceClosure;
69 class CompactibleSpaceClosure;
70 class Space;
71 class G1CollectionSet;
72 class G1CollectorPolicy;
73 class G1Policy;
74 class G1HotCardCache;
75 class G1RemSet;
76 class G1YoungRemSetSamplingThread;
77 class GCMemoryManager;
78 class HeapRegionRemSetIterator;
79 class G1ConcurrentMark;
80 class ConcurrentMarkThread;
81 class G1ConcurrentRefine;
82 class GenerationCounters;
83 class STWGCTimer;
84 class G1NewTracer;
85 class EvacuationFailedInfo;
86 class nmethod;
87 class Ticks;
88 class WorkGang;
89 class G1Allocator;
90 class G1ArchiveAllocator;
91 class G1FullGCScope;
92 class G1HeapVerifier;
93 class G1HeapSizingPolicy;
94 class G1HeapSummary;
95 class G1EvacSummary;
96
97 typedef OverflowTaskQueue<StarTask, mtGC> RefToScanQueue;
132
133 // Closures used in implementation.
134 friend class G1ParScanThreadState;
135 friend class G1ParScanThreadStateSet;
136 friend class G1ParTask;
137 friend class G1PLABAllocator;
138 friend class G1PrepareCompactClosure;
139
140 // Other related classes.
141 friend class HeapRegionClaimer;
142
143 // Testing classes.
144 friend class G1CheckCSetFastTableClosure;
145
146 private:
147 G1YoungRemSetSamplingThread* _young_gen_sampling_thread;
148
149 WorkGang* _workers;
150 G1CollectorPolicy* _collector_policy;
151
152 GCMemoryManager* _minor_mgr;
153 GCMemoryManager* _major_mgr;
154
155 static size_t _humongous_object_threshold_in_words;
156
157 // The secondary free list which contains regions that have been
158 // freed up during the cleanup process. This will be appended to
159 // the master free list when appropriate.
160 FreeRegionList _secondary_free_list;
161
162 // It keeps track of the old regions.
163 HeapRegionSet _old_set;
164
165 // It keeps track of the humongous regions.
166 HeapRegionSet _humongous_set;
167
168 void eagerly_reclaim_humongous_regions();
169 // Start a new incremental collection set for the next pause.
170 void start_new_collection_set();
171
172 // The number of regions we could create by expansion.
173 uint _expansion_regions;
174
992 return CollectedHeap::G1CollectedHeap;
993 }
994
995 virtual const char* name() const {
996 return "G1";
997 }
998
999 const G1CollectorState* collector_state() const { return &_collector_state; }
1000 G1CollectorState* collector_state() { return &_collector_state; }
1001
1002 // The current policy object for the collector.
1003 G1Policy* g1_policy() const { return _g1_policy; }
1004
1005 const G1CollectionSet* collection_set() const { return &_collection_set; }
1006 G1CollectionSet* collection_set() { return &_collection_set; }
1007
1008 virtual CollectorPolicy* collector_policy() const;
1009
1010 // Adaptive size policy. No such thing for g1.
1011 virtual AdaptiveSizePolicy* size_policy() { return NULL; }
1012
1013 virtual GrowableArray<GCMemoryManager*> memory_managers();
1014 virtual GrowableArray<MemoryPool*> memory_pools();
1015
1016 // The rem set and barrier set.
1017 G1RemSet* g1_rem_set() const { return _g1_rem_set; }
1018
1019 // Try to minimize the remembered set.
1020 void scrub_rem_set();
1021
1022 uint get_gc_time_stamp() {
1023 return _gc_time_stamp;
1024 }
1025
1026 inline void reset_gc_time_stamp();
1027
1028 void check_gc_time_stamps() PRODUCT_RETURN;
1029
1030 inline void increment_gc_time_stamp();
1031
1032 // Reset the given region's GC timestamp. If it's starts humongous,
1033 // also reset the GC timestamp of its corresponding
1034 // continues humongous regions too.
|