290 assert(!AlwaysTenure || _tenuring_threshold == 0, "Sanity");
291
292 // Fill in TLABs
293 heap->accumulate_statistics_all_tlabs();
294 heap->ensure_parsability(true); // retire TLABs
295
296 if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
297 HandleMark hm; // Discard invalid handles created during verification
298 Universe::verify("Before GC");
299 }
300
301 {
302 ResourceMark rm;
303 HandleMark hm;
304
305 GCTraceCPUTime tcpu;
306 GCTraceTime(Info, gc) tm("Pause Young", NULL, gc_cause, true);
307 TraceCollectorStats tcs(counters());
308 TraceMemoryManagerStats tms(false /* not full GC */,gc_cause);
309
310 if (TraceYoungGenTime) accumulated_time()->start();
311
312 // Let the size policy know we're starting
313 size_policy->minor_collection_begin();
314
315 // Verify the object start arrays.
316 if (VerifyObjectStartArray &&
317 VerifyBeforeGC) {
318 old_gen->verify_object_start_array();
319 }
320
321 // Verify no unmarked old->young roots
322 if (VerifyRememberedSets) {
323 CardTableExtension::verify_all_young_refs_imprecise();
324 }
325
326 assert(young_gen->to_space()->is_empty(),
327 "Attempt to scavenge with live objects in to_space");
328 young_gen->to_space()->clear(SpaceDecorator::Mangle);
329
330 save_to_space_top_before_gc();
592 #if defined(COMPILER2) || INCLUDE_JVMCI
593 DerivedPointerTable::update_pointers();
594 #endif
595
596 NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
597
598 // Re-verify object start arrays
599 if (VerifyObjectStartArray &&
600 VerifyAfterGC) {
601 old_gen->verify_object_start_array();
602 }
603
604 // Verify all old -> young cards are now precise
605 if (VerifyRememberedSets) {
606 // Precise verification will give false positives. Until this is fixed,
607 // use imprecise verification.
608 // CardTableExtension::verify_all_young_refs_precise();
609 CardTableExtension::verify_all_young_refs_imprecise();
610 }
611
612 if (TraceYoungGenTime) accumulated_time()->stop();
613
614 young_gen->print_used_change(pre_gc_values.young_gen_used());
615 old_gen->print_used_change(pre_gc_values.old_gen_used());
616 MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used());
617
618 // Track memory usage and detect low memory
619 MemoryService::track_memory_usage();
620 heap->update_counters();
621
622 gc_task_manager()->release_idle_workers();
623 }
624
625 if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
626 HandleMark hm; // Discard invalid handles created during verification
627 Universe::verify("After GC");
628 }
629
630 heap->print_heap_after_gc();
631 heap->trace_heap_after_gc(&_gc_tracer);
632
|
290 assert(!AlwaysTenure || _tenuring_threshold == 0, "Sanity");
291
292 // Fill in TLABs
293 heap->accumulate_statistics_all_tlabs();
294 heap->ensure_parsability(true); // retire TLABs
295
296 if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
297 HandleMark hm; // Discard invalid handles created during verification
298 Universe::verify("Before GC");
299 }
300
301 {
302 ResourceMark rm;
303 HandleMark hm;
304
305 GCTraceCPUTime tcpu;
306 GCTraceTime(Info, gc) tm("Pause Young", NULL, gc_cause, true);
307 TraceCollectorStats tcs(counters());
308 TraceMemoryManagerStats tms(false /* not full GC */,gc_cause);
309
310 if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->start();
311
312 // Let the size policy know we're starting
313 size_policy->minor_collection_begin();
314
315 // Verify the object start arrays.
316 if (VerifyObjectStartArray &&
317 VerifyBeforeGC) {
318 old_gen->verify_object_start_array();
319 }
320
321 // Verify no unmarked old->young roots
322 if (VerifyRememberedSets) {
323 CardTableExtension::verify_all_young_refs_imprecise();
324 }
325
326 assert(young_gen->to_space()->is_empty(),
327 "Attempt to scavenge with live objects in to_space");
328 young_gen->to_space()->clear(SpaceDecorator::Mangle);
329
330 save_to_space_top_before_gc();
592 #if defined(COMPILER2) || INCLUDE_JVMCI
593 DerivedPointerTable::update_pointers();
594 #endif
595
596 NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
597
598 // Re-verify object start arrays
599 if (VerifyObjectStartArray &&
600 VerifyAfterGC) {
601 old_gen->verify_object_start_array();
602 }
603
604 // Verify all old -> young cards are now precise
605 if (VerifyRememberedSets) {
606 // Precise verification will give false positives. Until this is fixed,
607 // use imprecise verification.
608 // CardTableExtension::verify_all_young_refs_precise();
609 CardTableExtension::verify_all_young_refs_imprecise();
610 }
611
612 if (log_is_enabled(Debug, gc, heap, exit)) accumulated_time()->stop();
613
614 young_gen->print_used_change(pre_gc_values.young_gen_used());
615 old_gen->print_used_change(pre_gc_values.old_gen_used());
616 MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used());
617
618 // Track memory usage and detect low memory
619 MemoryService::track_memory_usage();
620 heap->update_counters();
621
622 gc_task_manager()->release_idle_workers();
623 }
624
625 if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
626 HandleMark hm; // Discard invalid handles created during verification
627 Universe::verify("After GC");
628 }
629
630 heap->print_heap_after_gc();
631 heap->trace_heap_after_gc(&_gc_tracer);
632
|