101 max_gc_pause_sec,
102 max_gc_minor_pause_sec,
103 GCTimeRatio
104 );
105
106 assert(!UseAdaptiveGCBoundary ||
107 (old_gen()->virtual_space()->high_boundary() ==
108 young_gen()->virtual_space()->low_boundary()),
109 "Boundaries must meet");
110 // initialize the policy counters - 2 collectors, 2 generations
111 _gc_policy_counters =
112 new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);
113
114 // Set up the GCTaskManager
115 _gc_task_manager = GCTaskManager::create(ParallelGCThreads);
116
117 if (UseParallelOldGC && !PSParallelCompact::initialize()) {
118 return JNI_ENOMEM;
119 }
120
121
122 _eden_pool = new EdenMutableSpacePool(_young_gen,
123 _young_gen->eden_space(),
124 "PS Eden Space",
125 false /* support_usage_threshold */);
126
127 _survivor_pool = new SurvivorMutableSpacePool(_young_gen,
128 "PS Survivor Space",
129 false /* support_usage_threshold */);
130
131 _old_pool = new PSGenerationPool(_old_gen,
132 "PS Old Gen",
133 true /* support_usage_threshold */);
134
135 _young_manager = new GCMemoryManager("PS Scavenge", "end of minor GC");
136 _old_manager = new GCMemoryManager("PS MarkSweep", "end of major GC");
137
138 _old_manager->add_pool(_eden_pool);
139 _old_manager->add_pool(_survivor_pool);
140 _old_manager->add_pool(_old_pool);
141
142 _young_manager->add_pool(_eden_pool);
143 _young_manager->add_pool(_survivor_pool);
144
145 return JNI_OK;
146 }
147
148 void ParallelScavengeHeap::post_initialize() {
149 // Need to init the tenuring threshold
150 PSScavenge::initialize();
151 if (UseParallelOldGC) {
152 PSParallelCompact::post_initialize();
153 } else {
154 PSMarkSweep::initialize();
155 }
156 PSPromotionManager::initialize();
157 }
158
159 void ParallelScavengeHeap::update_counters() {
160 young_gen()->update_counters();
161 old_gen()->update_counters();
162 MetaspaceCounters::update_performance_counters();
163 CompressedClassSpaceCounters::update_performance_counters();
164 }
165
166 size_t ParallelScavengeHeap::capacity() const {
167 size_t value = young_gen()->capacity_in_bytes() + old_gen()->capacity_in_bytes();
168 return value;
|
101 max_gc_pause_sec,
102 max_gc_minor_pause_sec,
103 GCTimeRatio
104 );
105
106 assert(!UseAdaptiveGCBoundary ||
107 (old_gen()->virtual_space()->high_boundary() ==
108 young_gen()->virtual_space()->low_boundary()),
109 "Boundaries must meet");
110 // initialize the policy counters - 2 collectors, 2 generations
111 _gc_policy_counters =
112 new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);
113
114 // Set up the GCTaskManager
115 _gc_task_manager = GCTaskManager::create(ParallelGCThreads);
116
117 if (UseParallelOldGC && !PSParallelCompact::initialize()) {
118 return JNI_ENOMEM;
119 }
120
121 return JNI_OK;
122 }
123
124 void ParallelScavengeHeap::initialize_serviceability() {
125
126 _eden_pool = new EdenMutableSpacePool(_young_gen,
127 _young_gen->eden_space(),
128 "PS Eden Space",
129 false /* support_usage_threshold */);
130
131 _survivor_pool = new SurvivorMutableSpacePool(_young_gen,
132 "PS Survivor Space",
133 false /* support_usage_threshold */);
134
135 _old_pool = new PSGenerationPool(_old_gen,
136 "PS Old Gen",
137 true /* support_usage_threshold */);
138
139 _young_manager = new GCMemoryManager("PS Scavenge", "end of minor GC");
140 _old_manager = new GCMemoryManager("PS MarkSweep", "end of major GC");
141
142 _old_manager->add_pool(_eden_pool);
143 _old_manager->add_pool(_survivor_pool);
144 _old_manager->add_pool(_old_pool);
145
146 _young_manager->add_pool(_eden_pool);
147 _young_manager->add_pool(_survivor_pool);
148
149 }
150
151 void ParallelScavengeHeap::post_initialize() {
152 CollectedHeap::post_initialize();
153 // Need to init the tenuring threshold
154 PSScavenge::initialize();
155 if (UseParallelOldGC) {
156 PSParallelCompact::post_initialize();
157 } else {
158 PSMarkSweep::initialize();
159 }
160 PSPromotionManager::initialize();
161 }
162
163 void ParallelScavengeHeap::update_counters() {
164 young_gen()->update_counters();
165 old_gen()->update_counters();
166 MetaspaceCounters::update_performance_counters();
167 CompressedClassSpaceCounters::update_performance_counters();
168 }
169
170 size_t ParallelScavengeHeap::capacity() const {
171 size_t value = young_gen()->capacity_in_bytes() + old_gen()->capacity_in_bytes();
172 return value;
|