< prev index next >

src/share/vm/gc/parallel/psMarkSweep.cpp

Print this page




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




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


< prev index next >