161
162 void TenuredGeneration::collect(bool full,
163 bool clear_all_soft_refs,
164 size_t size,
165 bool is_tlab) {
166 GenCollectedHeap* gch = GenCollectedHeap::heap();
167
168 // Temporarily expand the span of our ref processor, so
169 // refs discovery is over the entire heap, not just this generation
170 ReferenceProcessorSpanMutator
171 x(ref_processor(), gch->reserved_region());
172
173 STWGCTimer* gc_timer = GenMarkSweep::gc_timer();
174 gc_timer->register_gc_start();
175
176 SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
177 gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
178
179 gch->pre_full_gc_dump(gc_timer);
180
181 GenMarkSweep::invoke_at_safepoint(ref_processor(), clear_all_soft_refs);
182
183 gch->post_full_gc_dump(gc_timer);
184
185 gc_timer->register_gc_end();
186
187 gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
188 }
189
190 HeapWord*
191 TenuredGeneration::expand_and_allocate(size_t word_size,
192 bool is_tlab,
193 bool parallel) {
194 assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
195 if (parallel) {
196 MutexLocker x(ParGCRareEvent_lock);
197 HeapWord* result = NULL;
198 size_t byte_size = word_size * HeapWordSize;
199 while (true) {
200 expand(byte_size, _min_heap_delta_bytes);
201 if (GCExpandToAllocateDelayMillis > 0) {
|
161
162 void TenuredGeneration::collect(bool full,
163 bool clear_all_soft_refs,
164 size_t size,
165 bool is_tlab) {
166 GenCollectedHeap* gch = GenCollectedHeap::heap();
167
168 // Temporarily expand the span of our ref processor, so
169 // refs discovery is over the entire heap, not just this generation
170 ReferenceProcessorSpanMutator
171 x(ref_processor(), gch->reserved_region());
172
173 STWGCTimer* gc_timer = GenMarkSweep::gc_timer();
174 gc_timer->register_gc_start();
175
176 SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
177 gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
178
179 gch->pre_full_gc_dump(gc_timer);
180
181 GenMarkSweep gms;
182 gms.invoke_at_safepoint(ref_processor(), clear_all_soft_refs);
183
184 gch->post_full_gc_dump(gc_timer);
185
186 gc_timer->register_gc_end();
187
188 gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
189 }
190
191 HeapWord*
192 TenuredGeneration::expand_and_allocate(size_t word_size,
193 bool is_tlab,
194 bool parallel) {
195 assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
196 if (parallel) {
197 MutexLocker x(ParGCRareEvent_lock);
198 HeapWord* result = NULL;
199 size_t byte_size = word_size * HeapWordSize;
200 while (true) {
201 expand(byte_size, _min_heap_delta_bytes);
202 if (GCExpandToAllocateDelayMillis > 0) {
|