43 #include "gc/shared/isGCActiveMark.hpp"
44 #include "gc/shared/referencePolicy.hpp"
45 #include "gc/shared/referenceProcessor.hpp"
46 #include "gc/shared/spaceDecorator.hpp"
47 #include "gc/shared/weakProcessor.hpp"
48 #include "memory/resourceArea.hpp"
49 #include "logging/log.hpp"
50 #include "oops/access.inline.hpp"
51 #include "oops/compressedOops.inline.hpp"
52 #include "oops/oop.inline.hpp"
53 #include "runtime/biasedLocking.hpp"
54 #include "runtime/handles.inline.hpp"
55 #include "runtime/threadCritical.hpp"
56 #include "runtime/vmThread.hpp"
57 #include "runtime/vm_operations.hpp"
58 #include "services/memoryService.hpp"
59 #include "utilities/stack.inline.hpp"
60
61 HeapWord* PSScavenge::_to_space_top_before_gc = NULL;
62 int PSScavenge::_consecutive_skipped_scavenges = 0;
63 SpanReferenceProcessor* PSScavenge::_ref_processor = NULL;
64 PSCardTable* PSScavenge::_card_table = NULL;
65 bool PSScavenge::_survivor_overflow = false;
66 uint PSScavenge::_tenuring_threshold = 0;
67 HeapWord* PSScavenge::_young_generation_boundary = NULL;
68 uintptr_t PSScavenge::_young_generation_boundary_compressed = 0;
69 elapsedTimer PSScavenge::_accumulated_time;
70 STWGCTimer PSScavenge::_gc_timer;
71 ParallelScavengeTracer PSScavenge::_gc_tracer;
72 CollectorCounters* PSScavenge::_counters = NULL;
73
74 // Define before use
75 class PSIsAliveClosure: public BoolObjectClosure {
76 public:
77 bool do_object_b(oop p) {
78 return (!PSScavenge::is_obj_in_young(p)) || p->is_forwarded();
79 }
80 };
81
82 PSIsAliveClosure PSScavenge::_is_alive_closure;
83
749 if (AlwaysTenure || NeverTenure) {
750 assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1,
751 "MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is %d", (int) MaxTenuringThreshold);
752 _tenuring_threshold = MaxTenuringThreshold;
753 } else {
754 // We want to smooth out our startup times for the AdaptiveSizePolicy
755 _tenuring_threshold = (UseAdaptiveSizePolicy) ? InitialTenuringThreshold :
756 MaxTenuringThreshold;
757 }
758
759 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
760 PSYoungGen* young_gen = heap->young_gen();
761 PSOldGen* old_gen = heap->old_gen();
762
763 // Set boundary between young_gen and old_gen
764 assert(old_gen->reserved().end() <= young_gen->eden_space()->bottom(),
765 "old above young");
766 set_young_generation_boundary(young_gen->eden_space()->bottom());
767
768 // Initialize ref handling object for scavenging.
769 MemRegion mr = young_gen->reserved();
770
771 _ref_processor =
772 new SpanReferenceProcessor(mr, // span
773 ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
774 ParallelGCThreads, // mt processing degree
775 true, // mt discovery
776 ParallelGCThreads, // mt discovery degree
777 true, // atomic_discovery
778 NULL); // header provides liveness info
779
780 // Cache the cardtable
781 _card_table = heap->card_table();
782
783 _counters = new CollectorCounters("PSScavenge", 0);
784 }
|
43 #include "gc/shared/isGCActiveMark.hpp"
44 #include "gc/shared/referencePolicy.hpp"
45 #include "gc/shared/referenceProcessor.hpp"
46 #include "gc/shared/spaceDecorator.hpp"
47 #include "gc/shared/weakProcessor.hpp"
48 #include "memory/resourceArea.hpp"
49 #include "logging/log.hpp"
50 #include "oops/access.inline.hpp"
51 #include "oops/compressedOops.inline.hpp"
52 #include "oops/oop.inline.hpp"
53 #include "runtime/biasedLocking.hpp"
54 #include "runtime/handles.inline.hpp"
55 #include "runtime/threadCritical.hpp"
56 #include "runtime/vmThread.hpp"
57 #include "runtime/vm_operations.hpp"
58 #include "services/memoryService.hpp"
59 #include "utilities/stack.inline.hpp"
60
61 HeapWord* PSScavenge::_to_space_top_before_gc = NULL;
62 int PSScavenge::_consecutive_skipped_scavenges = 0;
63 SpanSubjectToDiscoveryClosure PSScavenge::_span_discoverer;
64 ReferenceProcessor* PSScavenge::_ref_processor = NULL;
65 PSCardTable* PSScavenge::_card_table = NULL;
66 bool PSScavenge::_survivor_overflow = false;
67 uint PSScavenge::_tenuring_threshold = 0;
68 HeapWord* PSScavenge::_young_generation_boundary = NULL;
69 uintptr_t PSScavenge::_young_generation_boundary_compressed = 0;
70 elapsedTimer PSScavenge::_accumulated_time;
71 STWGCTimer PSScavenge::_gc_timer;
72 ParallelScavengeTracer PSScavenge::_gc_tracer;
73 CollectorCounters* PSScavenge::_counters = NULL;
74
75 // Define before use
76 class PSIsAliveClosure: public BoolObjectClosure {
77 public:
78 bool do_object_b(oop p) {
79 return (!PSScavenge::is_obj_in_young(p)) || p->is_forwarded();
80 }
81 };
82
83 PSIsAliveClosure PSScavenge::_is_alive_closure;
84
750 if (AlwaysTenure || NeverTenure) {
751 assert(MaxTenuringThreshold == 0 || MaxTenuringThreshold == markOopDesc::max_age + 1,
752 "MaxTenuringThreshold should be 0 or markOopDesc::max_age + 1, but is %d", (int) MaxTenuringThreshold);
753 _tenuring_threshold = MaxTenuringThreshold;
754 } else {
755 // We want to smooth out our startup times for the AdaptiveSizePolicy
756 _tenuring_threshold = (UseAdaptiveSizePolicy) ? InitialTenuringThreshold :
757 MaxTenuringThreshold;
758 }
759
760 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
761 PSYoungGen* young_gen = heap->young_gen();
762 PSOldGen* old_gen = heap->old_gen();
763
764 // Set boundary between young_gen and old_gen
765 assert(old_gen->reserved().end() <= young_gen->eden_space()->bottom(),
766 "old above young");
767 set_young_generation_boundary(young_gen->eden_space()->bottom());
768
769 // Initialize ref handling object for scavenging.
770 _span_discoverer.set_span(young_gen->reserved());
771 _ref_processor =
772 new ReferenceProcessor(&_span_discoverer, // span
773 ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
774 ParallelGCThreads, // mt processing degree
775 true, // mt discovery
776 ParallelGCThreads, // mt discovery degree
777 true, // atomic_discovery
778 NULL); // header provides liveness info
779
780 // Cache the cardtable
781 _card_table = heap->card_table();
782
783 _counters = new CollectorCounters("PSScavenge", 0);
784 }
|