49 #include "gc/shared/spaceDecorator.hpp"
50 #include "gc/shared/weakProcessor.hpp"
51 #include "logging/log.hpp"
52 #include "oops/oop.inline.hpp"
53 #include "runtime/biasedLocking.hpp"
54 #include "runtime/handles.inline.hpp"
55 #include "runtime/safepoint.hpp"
56 #include "runtime/vmThread.hpp"
57 #include "services/management.hpp"
58 #include "services/memoryService.hpp"
59 #include "utilities/align.hpp"
60 #include "utilities/events.hpp"
61 #include "utilities/stack.inline.hpp"
62
63 elapsedTimer PSMarkSweep::_accumulated_time;
64 jlong PSMarkSweep::_time_of_last_gc = 0;
65 CollectorCounters* PSMarkSweep::_counters = NULL;
66
67 void PSMarkSweep::initialize() {
68 MemRegion mr = ParallelScavengeHeap::heap()->reserved_region();
69 set_ref_processor(new ReferenceProcessor(mr)); // a vanilla ref proc
70 _counters = new CollectorCounters("PSMarkSweep", 1);
71 }
72
73 // This method contains all heap specific policy for invoking mark sweep.
74 // PSMarkSweep::invoke_no_policy() will only attempt to mark-sweep-compact
75 // the heap. It will do nothing further. If we need to bail out for policy
76 // reasons, scavenge before full gc, or any other specialized behavior, it
77 // needs to be added here.
78 //
79 // Note that this method should only be called from the vm_thread while
80 // at a safepoint!
81 //
82 // Note that the all_soft_refs_clear flag in the collector policy
83 // may be true because this method can be called without intervening
84 // activity. For example when the heap space is tight and full measure
85 // are being taken to free space.
86
87 void PSMarkSweep::invoke(bool maximum_heap_compaction) {
88 assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint");
89 assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
|
49 #include "gc/shared/spaceDecorator.hpp"
50 #include "gc/shared/weakProcessor.hpp"
51 #include "logging/log.hpp"
52 #include "oops/oop.inline.hpp"
53 #include "runtime/biasedLocking.hpp"
54 #include "runtime/handles.inline.hpp"
55 #include "runtime/safepoint.hpp"
56 #include "runtime/vmThread.hpp"
57 #include "services/management.hpp"
58 #include "services/memoryService.hpp"
59 #include "utilities/align.hpp"
60 #include "utilities/events.hpp"
61 #include "utilities/stack.inline.hpp"
62
63 elapsedTimer PSMarkSweep::_accumulated_time;
64 jlong PSMarkSweep::_time_of_last_gc = 0;
65 CollectorCounters* PSMarkSweep::_counters = NULL;
66
67 void PSMarkSweep::initialize() {
68 MemRegion mr = ParallelScavengeHeap::heap()->reserved_region();
69 set_ref_processor(new SpanReferenceProcessor(mr)); // a vanilla ref proc
70 _counters = new CollectorCounters("PSMarkSweep", 1);
71 }
72
73 // This method contains all heap specific policy for invoking mark sweep.
74 // PSMarkSweep::invoke_no_policy() will only attempt to mark-sweep-compact
75 // the heap. It will do nothing further. If we need to bail out for policy
76 // reasons, scavenge before full gc, or any other specialized behavior, it
77 // needs to be added here.
78 //
79 // Note that this method should only be called from the vm_thread while
80 // at a safepoint!
81 //
82 // Note that the all_soft_refs_clear flag in the collector policy
83 // may be true because this method can be called without intervening
84 // activity. For example when the heap space is tight and full measure
85 // are being taken to free space.
86
87 void PSMarkSweep::invoke(bool maximum_heap_compaction) {
88 assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint");
89 assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
|