133 // The scope of casr should end after code that can change
134 // CollectorPolicy::_should_clear_all_soft_refs.
135 ClearedAllSoftRefs casr(clear_all_softrefs, heap->soft_ref_policy());
136
137 PSYoungGen* young_gen = heap->young_gen();
138 PSOldGen* old_gen = heap->old_gen();
139
140 // Increment the invocation count
141 heap->increment_total_collections(true /* full */);
142
143 // Save information needed to minimize mangling
144 heap->record_gen_tops_before_GC();
145
146 // We need to track unique mark sweep invocations as well.
147 _total_invocations++;
148
149 heap->print_heap_before_gc();
150 heap->trace_heap_before_gc(_gc_tracer);
151
152 // Fill in TLABs
153 heap->accumulate_statistics_all_tlabs();
154 heap->ensure_parsability(true); // retire TLABs
155
156 if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
157 HandleMark hm; // Discard invalid handles created during verification
158 Universe::verify("Before GC");
159 }
160
161 // Verify object start arrays
162 if (VerifyObjectStartArray &&
163 VerifyBeforeGC) {
164 old_gen->verify_object_start_array();
165 }
166
167 // Filled in below to track the state of the young gen after the collection.
168 bool eden_empty;
169 bool survivors_empty;
170 bool young_gen_empty;
171
172 {
173 HandleMark hm;
|
133 // The scope of casr should end after code that can change
134 // CollectorPolicy::_should_clear_all_soft_refs.
135 ClearedAllSoftRefs casr(clear_all_softrefs, heap->soft_ref_policy());
136
137 PSYoungGen* young_gen = heap->young_gen();
138 PSOldGen* old_gen = heap->old_gen();
139
140 // Increment the invocation count
141 heap->increment_total_collections(true /* full */);
142
143 // Save information needed to minimize mangling
144 heap->record_gen_tops_before_GC();
145
146 // We need to track unique mark sweep invocations as well.
147 _total_invocations++;
148
149 heap->print_heap_before_gc();
150 heap->trace_heap_before_gc(_gc_tracer);
151
152 // Fill in TLABs
153 heap->ensure_parsability(true); // retire TLABs
154
155 if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
156 HandleMark hm; // Discard invalid handles created during verification
157 Universe::verify("Before GC");
158 }
159
160 // Verify object start arrays
161 if (VerifyObjectStartArray &&
162 VerifyBeforeGC) {
163 old_gen->verify_object_start_array();
164 }
165
166 // Filled in below to track the state of the young gen after the collection.
167 bool eden_empty;
168 bool survivors_empty;
169 bool young_gen_empty;
170
171 {
172 HandleMark hm;
|