< prev index next >

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

Print this page




 821 {
 822   verify_clear(_region_vspace);
 823   verify_clear(_block_vspace);
 824 }
 825 #endif  // #ifdef ASSERT
 826 
 827 STWGCTimer          PSParallelCompact::_gc_timer;
 828 ParallelOldTracer   PSParallelCompact::_gc_tracer;
 829 elapsedTimer        PSParallelCompact::_accumulated_time;
 830 unsigned int        PSParallelCompact::_total_invocations = 0;
 831 unsigned int        PSParallelCompact::_maximum_compaction_gc_num = 0;
 832 jlong               PSParallelCompact::_time_of_last_gc = 0;
 833 CollectorCounters*  PSParallelCompact::_counters = NULL;
 834 ParMarkBitMap       PSParallelCompact::_mark_bitmap;
 835 ParallelCompactData PSParallelCompact::_summary_data;
 836 
 837 PSParallelCompact::IsAliveClosure PSParallelCompact::_is_alive_closure;
 838 
 839 bool PSParallelCompact::IsAliveClosure::do_object_b(oop p) { return mark_bitmap()->is_marked(p); }
 840 
 841 void PSParallelCompact::AdjustKlassClosure::do_klass(Klass* klass) {
 842   PSParallelCompact::AdjustPointerClosure closure(_cm);
 843   klass->oops_do(&closure);
 844 }
 845 
 846 void PSParallelCompact::post_initialize() {
 847   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 848   MemRegion mr = heap->reserved_region();
 849   _ref_processor =
 850     new ReferenceProcessor(mr,            // span
 851                            ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
 852                            ParallelGCThreads, // mt processing degree
 853                            true,              // mt discovery
 854                            ParallelGCThreads, // mt discovery degree
 855                            true,              // atomic_discovery
 856                            &_is_alive_closure); // non-header is alive closure
 857   _counters = new CollectorCounters("PSParallelCompact", 1);
 858 
 859   // Initialize static fields in ParCompactionManager.
 860   ParCompactionManager::initialize(mark_bitmap());
 861 }
 862 
 863 bool PSParallelCompact::initialize() {
 864   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 865   MemRegion mr = heap->reserved_region();


2143     StringTable::unlink(is_alive_closure());
2144   }
2145 
2146   {
2147     GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", &_gc_timer);
2148     // Clean up unreferenced symbols in symbol table.
2149     SymbolTable::unlink();
2150   }
2151 
2152   _gc_tracer.report_object_count_after_gc(is_alive_closure());
2153 }
2154 
2155 void PSParallelCompact::adjust_roots(ParCompactionManager* cm) {
2156   // Adjust the pointers to reflect the new locations
2157   GCTraceTime(Info, gc, phases) tm("Adjust Roots", &_gc_timer);
2158 
2159   // Need new claim bits when tracing through and adjusting pointers.
2160   ClassLoaderDataGraph::clear_claimed_marks();
2161 
2162   PSParallelCompact::AdjustPointerClosure oop_closure(cm);
2163   PSParallelCompact::AdjustKlassClosure klass_closure(cm);
2164 
2165   // General strong roots.
2166   Universe::oops_do(&oop_closure);
2167   JNIHandles::oops_do(&oop_closure);   // Global (strong) JNI handles
2168   Threads::oops_do(&oop_closure, NULL);
2169   ObjectSynchronizer::oops_do(&oop_closure);
2170   Management::oops_do(&oop_closure);
2171   JvmtiExport::oops_do(&oop_closure);
2172   SystemDictionary::oops_do(&oop_closure);
2173   ClassLoaderDataGraph::oops_do(&oop_closure, &klass_closure, true);
2174 
2175   // Now adjust pointers in remaining weak roots.  (All of which should
2176   // have been cleared if they pointed to non-surviving objects.)
2177   // Global (weak) JNI handles
2178   JNIHandles::weak_oops_do(&oop_closure);
2179 
2180   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
2181   CodeCache::blobs_do(&adjust_from_blobs);
2182   AOTLoader::oops_do(&oop_closure);
2183   StringTable::oops_do(&oop_closure);
2184   ref_processor()->weak_oops_do(&oop_closure);
2185   // Roots were visited so references into the young gen in roots
2186   // may have been scanned.  Process them also.
2187   // Should the reference processor have a span that excludes
2188   // young gen objects?
2189   PSScavenge::reference_processor()->weak_oops_do(&oop_closure);
2190 }
2191 
2192 // Helper class to print 8 region numbers per line and then print the total at the end.
2193 class FillableRegionLogger : public StackObj {




 821 {
 822   verify_clear(_region_vspace);
 823   verify_clear(_block_vspace);
 824 }
 825 #endif  // #ifdef ASSERT
 826 
 827 STWGCTimer          PSParallelCompact::_gc_timer;
 828 ParallelOldTracer   PSParallelCompact::_gc_tracer;
 829 elapsedTimer        PSParallelCompact::_accumulated_time;
 830 unsigned int        PSParallelCompact::_total_invocations = 0;
 831 unsigned int        PSParallelCompact::_maximum_compaction_gc_num = 0;
 832 jlong               PSParallelCompact::_time_of_last_gc = 0;
 833 CollectorCounters*  PSParallelCompact::_counters = NULL;
 834 ParMarkBitMap       PSParallelCompact::_mark_bitmap;
 835 ParallelCompactData PSParallelCompact::_summary_data;
 836 
 837 PSParallelCompact::IsAliveClosure PSParallelCompact::_is_alive_closure;
 838 
 839 bool PSParallelCompact::IsAliveClosure::do_object_b(oop p) { return mark_bitmap()->is_marked(p); }
 840 





 841 void PSParallelCompact::post_initialize() {
 842   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 843   MemRegion mr = heap->reserved_region();
 844   _ref_processor =
 845     new ReferenceProcessor(mr,            // span
 846                            ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
 847                            ParallelGCThreads, // mt processing degree
 848                            true,              // mt discovery
 849                            ParallelGCThreads, // mt discovery degree
 850                            true,              // atomic_discovery
 851                            &_is_alive_closure); // non-header is alive closure
 852   _counters = new CollectorCounters("PSParallelCompact", 1);
 853 
 854   // Initialize static fields in ParCompactionManager.
 855   ParCompactionManager::initialize(mark_bitmap());
 856 }
 857 
 858 bool PSParallelCompact::initialize() {
 859   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 860   MemRegion mr = heap->reserved_region();


2138     StringTable::unlink(is_alive_closure());
2139   }
2140 
2141   {
2142     GCTraceTime(Debug, gc, phases) t("Scrub Symbol Table", &_gc_timer);
2143     // Clean up unreferenced symbols in symbol table.
2144     SymbolTable::unlink();
2145   }
2146 
2147   _gc_tracer.report_object_count_after_gc(is_alive_closure());
2148 }
2149 
2150 void PSParallelCompact::adjust_roots(ParCompactionManager* cm) {
2151   // Adjust the pointers to reflect the new locations
2152   GCTraceTime(Info, gc, phases) tm("Adjust Roots", &_gc_timer);
2153 
2154   // Need new claim bits when tracing through and adjusting pointers.
2155   ClassLoaderDataGraph::clear_claimed_marks();
2156 
2157   PSParallelCompact::AdjustPointerClosure oop_closure(cm);

2158 
2159   // General strong roots.
2160   Universe::oops_do(&oop_closure);
2161   JNIHandles::oops_do(&oop_closure);   // Global (strong) JNI handles
2162   Threads::oops_do(&oop_closure, NULL);
2163   ObjectSynchronizer::oops_do(&oop_closure);
2164   Management::oops_do(&oop_closure);
2165   JvmtiExport::oops_do(&oop_closure);
2166   SystemDictionary::oops_do(&oop_closure);
2167   ClassLoaderDataGraph::oops_do(&oop_closure, true);
2168 
2169   // Now adjust pointers in remaining weak roots.  (All of which should
2170   // have been cleared if they pointed to non-surviving objects.)
2171   // Global (weak) JNI handles
2172   JNIHandles::weak_oops_do(&oop_closure);
2173 
2174   CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations);
2175   CodeCache::blobs_do(&adjust_from_blobs);
2176   AOTLoader::oops_do(&oop_closure);
2177   StringTable::oops_do(&oop_closure);
2178   ref_processor()->weak_oops_do(&oop_closure);
2179   // Roots were visited so references into the young gen in roots
2180   // may have been scanned.  Process them also.
2181   // Should the reference processor have a span that excludes
2182   // young gen objects?
2183   PSScavenge::reference_processor()->weak_oops_do(&oop_closure);
2184 }
2185 
2186 // Helper class to print 8 region numbers per line and then print the total at the end.
2187 class FillableRegionLogger : public StackObj {


< prev index next >