28 #include "gc/parallel/cardTableExtension.hpp"
29 #include "gc/parallel/gcTaskManager.hpp"
30 #include "gc/parallel/parallelScavengeHeap.hpp"
31 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
32 #include "gc/parallel/psMarkSweep.hpp"
33 #include "gc/parallel/psParallelCompact.inline.hpp"
34 #include "gc/parallel/psScavenge.inline.hpp"
35 #include "gc/parallel/psTasks.hpp"
36 #include "gc/shared/collectorPolicy.hpp"
37 #include "gc/shared/gcCause.hpp"
38 #include "gc/shared/gcHeapSummary.hpp"
39 #include "gc/shared/gcId.hpp"
40 #include "gc/shared/gcLocker.inline.hpp"
41 #include "gc/shared/gcTimer.hpp"
42 #include "gc/shared/gcTrace.hpp"
43 #include "gc/shared/gcTraceTime.inline.hpp"
44 #include "gc/shared/isGCActiveMark.hpp"
45 #include "gc/shared/referencePolicy.hpp"
46 #include "gc/shared/referenceProcessor.hpp"
47 #include "gc/shared/spaceDecorator.hpp"
48 #include "memory/resourceArea.hpp"
49 #include "logging/log.hpp"
50 #include "oops/oop.inline.hpp"
51 #include "runtime/biasedLocking.hpp"
52 #include "runtime/handles.inline.hpp"
53 #include "runtime/threadCritical.hpp"
54 #include "runtime/vmThread.hpp"
55 #include "runtime/vm_operations.hpp"
56 #include "services/memoryService.hpp"
57 #include "utilities/stack.inline.hpp"
58
59 HeapWord* PSScavenge::_to_space_top_before_gc = NULL;
60 int PSScavenge::_consecutive_skipped_scavenges = 0;
61 ReferenceProcessor* PSScavenge::_ref_processor = NULL;
62 CardTableExtension* PSScavenge::_card_table = NULL;
63 bool PSScavenge::_survivor_overflow = false;
64 uint PSScavenge::_tenuring_threshold = 0;
65 HeapWord* PSScavenge::_young_generation_boundary = NULL;
66 uintptr_t PSScavenge::_young_generation_boundary_compressed = 0;
67 elapsedTimer PSScavenge::_accumulated_time;
423 &pt);
424 } else {
425 stats = reference_processor()->process_discovered_references(
426 &_is_alive_closure, &keep_alive, &evac_followers, NULL, &pt);
427 }
428
429 _gc_tracer.report_gc_reference_stats(stats);
430 pt.print_all_references();
431
432 // Enqueue reference objects discovered during scavenge.
433 if (reference_processor()->processing_is_mt()) {
434 PSRefProcTaskExecutor task_executor;
435 reference_processor()->enqueue_discovered_references(&task_executor, &pt);
436 } else {
437 reference_processor()->enqueue_discovered_references(NULL, &pt);
438 }
439
440 pt.print_enqueue_phase();
441 }
442
443 {
444 GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
445 // Unlink any dead interned Strings and process the remaining live ones.
446 PSScavengeRootsClosure root_closure(promotion_manager);
447 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
448 }
449
450 // Finally, flush the promotion_manager's labs, and deallocate its stacks.
451 promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer);
452 if (promotion_failure_occurred) {
453 clean_up_failed_promotion();
454 log_info(gc, promotion)("Promotion failed");
455 }
456
457 _gc_tracer.report_tenuring_threshold(tenuring_threshold());
458
459 // Let the size policy know we're done. Note that we count promotion
460 // failure cleanup time as part of the collection (otherwise, we're
461 // implicitly saying it's mutator time).
462 size_policy->minor_collection_end(gc_cause);
463
464 if (!promotion_failure_occurred) {
465 // Swap the survivor spaces.
466 young_gen->eden_space()->clear(SpaceDecorator::Mangle);
|
28 #include "gc/parallel/cardTableExtension.hpp"
29 #include "gc/parallel/gcTaskManager.hpp"
30 #include "gc/parallel/parallelScavengeHeap.hpp"
31 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
32 #include "gc/parallel/psMarkSweep.hpp"
33 #include "gc/parallel/psParallelCompact.inline.hpp"
34 #include "gc/parallel/psScavenge.inline.hpp"
35 #include "gc/parallel/psTasks.hpp"
36 #include "gc/shared/collectorPolicy.hpp"
37 #include "gc/shared/gcCause.hpp"
38 #include "gc/shared/gcHeapSummary.hpp"
39 #include "gc/shared/gcId.hpp"
40 #include "gc/shared/gcLocker.inline.hpp"
41 #include "gc/shared/gcTimer.hpp"
42 #include "gc/shared/gcTrace.hpp"
43 #include "gc/shared/gcTraceTime.inline.hpp"
44 #include "gc/shared/isGCActiveMark.hpp"
45 #include "gc/shared/referencePolicy.hpp"
46 #include "gc/shared/referenceProcessor.hpp"
47 #include "gc/shared/spaceDecorator.hpp"
48 #include "gc/shared/weakProcessor.hpp"
49 #include "memory/resourceArea.hpp"
50 #include "logging/log.hpp"
51 #include "oops/oop.inline.hpp"
52 #include "runtime/biasedLocking.hpp"
53 #include "runtime/handles.inline.hpp"
54 #include "runtime/threadCritical.hpp"
55 #include "runtime/vmThread.hpp"
56 #include "runtime/vm_operations.hpp"
57 #include "services/memoryService.hpp"
58 #include "utilities/stack.inline.hpp"
59
60 HeapWord* PSScavenge::_to_space_top_before_gc = NULL;
61 int PSScavenge::_consecutive_skipped_scavenges = 0;
62 ReferenceProcessor* PSScavenge::_ref_processor = NULL;
63 CardTableExtension* PSScavenge::_card_table = NULL;
64 bool PSScavenge::_survivor_overflow = false;
65 uint PSScavenge::_tenuring_threshold = 0;
66 HeapWord* PSScavenge::_young_generation_boundary = NULL;
67 uintptr_t PSScavenge::_young_generation_boundary_compressed = 0;
68 elapsedTimer PSScavenge::_accumulated_time;
424 &pt);
425 } else {
426 stats = reference_processor()->process_discovered_references(
427 &_is_alive_closure, &keep_alive, &evac_followers, NULL, &pt);
428 }
429
430 _gc_tracer.report_gc_reference_stats(stats);
431 pt.print_all_references();
432
433 // Enqueue reference objects discovered during scavenge.
434 if (reference_processor()->processing_is_mt()) {
435 PSRefProcTaskExecutor task_executor;
436 reference_processor()->enqueue_discovered_references(&task_executor, &pt);
437 } else {
438 reference_processor()->enqueue_discovered_references(NULL, &pt);
439 }
440
441 pt.print_enqueue_phase();
442 }
443
444 PSScavengeRootsClosure root_closure(promotion_manager);
445
446 {
447 GCTraceTime(Debug, gc, phases) tm("Weak Processing", &_gc_timer);
448 WeakProcessor::weak_oops_do(&_is_alive_closure, &root_closure);
449 }
450
451 {
452 GCTraceTime(Debug, gc, phases) tm("Scrub String Table", &_gc_timer);
453 // Unlink any dead interned Strings and process the remaining live ones.
454 StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure);
455 }
456
457 // Finally, flush the promotion_manager's labs, and deallocate its stacks.
458 promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer);
459 if (promotion_failure_occurred) {
460 clean_up_failed_promotion();
461 log_info(gc, promotion)("Promotion failed");
462 }
463
464 _gc_tracer.report_tenuring_threshold(tenuring_threshold());
465
466 // Let the size policy know we're done. Note that we count promotion
467 // failure cleanup time as part of the collection (otherwise, we're
468 // implicitly saying it's mutator time).
469 size_policy->minor_collection_end(gc_cause);
470
471 if (!promotion_failure_occurred) {
472 // Swap the survivor spaces.
473 young_gen->eden_space()->clear(SpaceDecorator::Mangle);
|