181 gc_usage_array = _before_gc_usage_array;
182 } else {
183 gc_usage_array = _after_gc_usage_array;
184 }
185 gc_usage_array[pool_index] = usage;
186 }
187
188 void GCStatInfo::clear() {
189 _index = 0;
190 _start_time = 0L;
191 _end_time = 0L;
192 size_t len = _usage_array_size * sizeof(MemoryUsage);
193 memset(_before_gc_usage_array, 0, len);
194 memset(_after_gc_usage_array, 0, len);
195 }
196
197
198 GCMemoryManager::GCMemoryManager() : MemoryManager() {
199 _num_collections = 0;
200 _last_gc_stat = NULL;
201 _last_gc_lock = new Mutex(Mutex::leaf, "_last_gc_lock", true);
202 _current_gc_stat = NULL;
203 _num_gc_threads = 1;
204 _notification_enabled = false;
205 }
206
207 GCMemoryManager::~GCMemoryManager() {
208 delete _last_gc_stat;
209 delete _last_gc_lock;
210 delete _current_gc_stat;
211 }
212
213 void GCMemoryManager::initialize_gc_stat_info() {
214 assert(MemoryService::num_memory_pools() > 0, "should have one or more memory pools");
215 _last_gc_stat = new(ResourceObj::C_HEAP, mtGC) GCStatInfo(MemoryService::num_memory_pools());
216 _current_gc_stat = new(ResourceObj::C_HEAP, mtGC) GCStatInfo(MemoryService::num_memory_pools());
217 // tracking concurrent collections we need two objects: one to update, and one to
218 // hold the publicly available "last (completed) gc" information.
219 }
220
221 void GCMemoryManager::gc_begin(bool recordGCBeginTime, bool recordPreGCUsage,
|
181 gc_usage_array = _before_gc_usage_array;
182 } else {
183 gc_usage_array = _after_gc_usage_array;
184 }
185 gc_usage_array[pool_index] = usage;
186 }
187
188 void GCStatInfo::clear() {
189 _index = 0;
190 _start_time = 0L;
191 _end_time = 0L;
192 size_t len = _usage_array_size * sizeof(MemoryUsage);
193 memset(_before_gc_usage_array, 0, len);
194 memset(_after_gc_usage_array, 0, len);
195 }
196
197
198 GCMemoryManager::GCMemoryManager() : MemoryManager() {
199 _num_collections = 0;
200 _last_gc_stat = NULL;
201 _last_gc_lock = new Mutex(Mutex::leaf, "_last_gc_lock", true,
202 Monitor::_safepoint_check_never);
203 _current_gc_stat = NULL;
204 _num_gc_threads = 1;
205 _notification_enabled = false;
206 }
207
208 GCMemoryManager::~GCMemoryManager() {
209 delete _last_gc_stat;
210 delete _last_gc_lock;
211 delete _current_gc_stat;
212 }
213
214 void GCMemoryManager::initialize_gc_stat_info() {
215 assert(MemoryService::num_memory_pools() > 0, "should have one or more memory pools");
216 _last_gc_stat = new(ResourceObj::C_HEAP, mtGC) GCStatInfo(MemoryService::num_memory_pools());
217 _current_gc_stat = new(ResourceObj::C_HEAP, mtGC) GCStatInfo(MemoryService::num_memory_pools());
218 // tracking concurrent collections we need two objects: one to update, and one to
219 // hold the publicly available "last (completed) gc" information.
220 }
221
222 void GCMemoryManager::gc_begin(bool recordGCBeginTime, bool recordPreGCUsage,
|