17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP 26 #define SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP 27 28 #include "gc/parallel/generationSizer.hpp" 29 #include "gc/parallel/objectStartArray.hpp" 30 #include "gc/parallel/psGCAdaptivePolicyCounters.hpp" 31 #include "gc/parallel/psOldGen.hpp" 32 #include "gc/parallel/psYoungGen.hpp" 33 #include "gc/shared/collectedHeap.hpp" 34 #include "gc/shared/collectorPolicy.hpp" 35 #include "gc/shared/gcPolicyCounters.hpp" 36 #include "gc/shared/gcWhen.hpp" 37 #include "gc/shared/strongRootsScope.hpp" 38 #include "memory/metaspace.hpp" 39 #include "utilities/growableArray.hpp" 40 #include "utilities/ostream.hpp" 41 42 class AdjoiningGenerations; 43 class GCHeapSummary; 44 class GCTaskManager; 45 class MemoryManager; 46 class MemoryPool; 47 class PSAdaptiveSizePolicy; 48 class PSHeapSummary; 49 50 class ParallelScavengeHeap : public CollectedHeap { 51 friend class VMStructs; 52 private: 53 static PSYoungGen* _young_gen; 54 static PSOldGen* _old_gen; 55 56 // Sizing policy for entire heap 57 static PSAdaptiveSizePolicy* _size_policy; 58 static PSGCAdaptivePolicyCounters* _gc_policy_counters; 59 60 GenerationSizer* _collector_policy; 61 62 // Collection of generations that are adjacent in the 63 // space reserved for the heap. 64 AdjoiningGenerations* _gens; 65 unsigned int _death_march_count; 66 67 // The task manager 68 static GCTaskManager* _gc_task_manager; 69 70 GCMemoryManager* _young_manager; 71 GCMemoryManager* _old_manager; 72 73 MemoryPool* _eden_pool; 74 MemoryPool* _survivor_pool; 75 MemoryPool* _old_pool; 76 77 virtual void initialize_serviceability(); 78 79 void trace_heap(GCWhen::Type when, const GCTracer* tracer); 80 81 protected: 88 89 public: 90 ParallelScavengeHeap(GenerationSizer* policy) : 91 CollectedHeap(), _collector_policy(policy), _death_march_count(0) { } 92 93 // For use by VM operations 94 enum CollectionType { 95 Scavenge, 96 MarkSweep 97 }; 98 99 virtual Name kind() const { 100 return CollectedHeap::ParallelScavengeHeap; 101 } 102 103 virtual const char* name() const { 104 return "Parallel"; 105 } 106 107 virtual CollectorPolicy* collector_policy() const { return _collector_policy; } 108 109 virtual GrowableArray<GCMemoryManager*> memory_managers(); 110 virtual GrowableArray<MemoryPool*> memory_pools(); 111 112 static PSYoungGen* young_gen() { return _young_gen; } 113 static PSOldGen* old_gen() { return _old_gen; } 114 115 virtual PSAdaptiveSizePolicy* size_policy() { return _size_policy; } 116 117 static PSGCAdaptivePolicyCounters* gc_policy_counters() { return _gc_policy_counters; } 118 119 static ParallelScavengeHeap* heap(); 120 121 static GCTaskManager* const gc_task_manager() { return _gc_task_manager; } 122 123 AdjoiningGenerations* gens() { return _gens; } 124 125 // Returns JNI_OK on success 126 virtual jint initialize(); 127 | 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP 26 #define SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP 27 28 #include "gc/parallel/generationSizer.hpp" 29 #include "gc/parallel/objectStartArray.hpp" 30 #include "gc/parallel/psGCAdaptivePolicyCounters.hpp" 31 #include "gc/parallel/psOldGen.hpp" 32 #include "gc/parallel/psYoungGen.hpp" 33 #include "gc/shared/collectedHeap.hpp" 34 #include "gc/shared/collectorPolicy.hpp" 35 #include "gc/shared/gcPolicyCounters.hpp" 36 #include "gc/shared/gcWhen.hpp" 37 #include "gc/shared/softRefPolicy.hpp" 38 #include "gc/shared/strongRootsScope.hpp" 39 #include "memory/metaspace.hpp" 40 #include "utilities/growableArray.hpp" 41 #include "utilities/ostream.hpp" 42 43 class AdjoiningGenerations; 44 class GCHeapSummary; 45 class GCTaskManager; 46 class MemoryManager; 47 class MemoryPool; 48 class PSAdaptiveSizePolicy; 49 class PSHeapSummary; 50 51 class ParallelScavengeHeap : public CollectedHeap { 52 friend class VMStructs; 53 private: 54 static PSYoungGen* _young_gen; 55 static PSOldGen* _old_gen; 56 57 // Sizing policy for entire heap 58 static PSAdaptiveSizePolicy* _size_policy; 59 static PSGCAdaptivePolicyCounters* _gc_policy_counters; 60 61 GenerationSizer* _collector_policy; 62 63 SoftRefPolicy _soft_ref_policy; 64 65 // Collection of generations that are adjacent in the 66 // space reserved for the heap. 67 AdjoiningGenerations* _gens; 68 unsigned int _death_march_count; 69 70 // The task manager 71 static GCTaskManager* _gc_task_manager; 72 73 GCMemoryManager* _young_manager; 74 GCMemoryManager* _old_manager; 75 76 MemoryPool* _eden_pool; 77 MemoryPool* _survivor_pool; 78 MemoryPool* _old_pool; 79 80 virtual void initialize_serviceability(); 81 82 void trace_heap(GCWhen::Type when, const GCTracer* tracer); 83 84 protected: 91 92 public: 93 ParallelScavengeHeap(GenerationSizer* policy) : 94 CollectedHeap(), _collector_policy(policy), _death_march_count(0) { } 95 96 // For use by VM operations 97 enum CollectionType { 98 Scavenge, 99 MarkSweep 100 }; 101 102 virtual Name kind() const { 103 return CollectedHeap::ParallelScavengeHeap; 104 } 105 106 virtual const char* name() const { 107 return "Parallel"; 108 } 109 110 virtual CollectorPolicy* collector_policy() const { return _collector_policy; } 111 112 virtual SoftRefPolicy* soft_ref_policy() { return &_soft_ref_policy; } 113 114 virtual GrowableArray<GCMemoryManager*> memory_managers(); 115 virtual GrowableArray<MemoryPool*> memory_pools(); 116 117 static PSYoungGen* young_gen() { return _young_gen; } 118 static PSOldGen* old_gen() { return _old_gen; } 119 120 virtual PSAdaptiveSizePolicy* size_policy() { return _size_policy; } 121 122 static PSGCAdaptivePolicyCounters* gc_policy_counters() { return _gc_policy_counters; } 123 124 static ParallelScavengeHeap* heap(); 125 126 static GCTaskManager* const gc_task_manager() { return _gc_task_manager; } 127 128 AdjoiningGenerations* gens() { return _gens; } 129 130 // Returns JNI_OK on success 131 virtual jint initialize(); 132 |