105 MetaspaceUtils::used_bytes(), 106 MetaspaceUtils::reserved_bytes()); 107 const MetaspaceSizes data_space( 108 MetaspaceUtils::committed_bytes(Metaspace::NonClassType), 109 MetaspaceUtils::used_bytes(Metaspace::NonClassType), 110 MetaspaceUtils::reserved_bytes(Metaspace::NonClassType)); 111 const MetaspaceSizes class_space( 112 MetaspaceUtils::committed_bytes(Metaspace::ClassType), 113 MetaspaceUtils::used_bytes(Metaspace::ClassType), 114 MetaspaceUtils::reserved_bytes(Metaspace::ClassType)); 115 116 const MetaspaceChunkFreeListSummary& ms_chunk_free_list_summary = 117 MetaspaceUtils::chunk_free_list_summary(Metaspace::NonClassType); 118 const MetaspaceChunkFreeListSummary& class_chunk_free_list_summary = 119 MetaspaceUtils::chunk_free_list_summary(Metaspace::ClassType); 120 121 return MetaspaceSummary(MetaspaceGC::capacity_until_GC(), meta_space, data_space, class_space, 122 ms_chunk_free_list_summary, class_chunk_free_list_summary); 123 } 124 125 void CollectedHeap::run_task_at_safepoint(AbstractGangTask* task, uint num_workers) { 126 assert(SafepointSynchronize::is_at_safepoint(), "Should only be called at a safepoint"); 127 128 WorkGang* gang = get_safepoint_workers(); 129 if (gang == NULL) { 130 // GC doesn't support parallel worker threads. 131 // Execute in this thread with worker id 0. 132 task->work(0); 133 } else { 134 gang->run_task(task, num_workers); 135 } 136 } 137 138 void CollectedHeap::print_heap_before_gc() { 139 Universe::print_heap_before_gc(); 140 if (_gc_heap_log != NULL) { 141 _gc_heap_log->log_heap_before(this); 142 } 143 } 144 145 void CollectedHeap::print_heap_after_gc() { 146 Universe::print_heap_after_gc(); 147 if (_gc_heap_log != NULL) { 148 _gc_heap_log->log_heap_after(this); 149 } 150 } 151 152 void CollectedHeap::print() const { print_on(tty); } 153 154 void CollectedHeap::print_on_error(outputStream* st) const { 155 st->print_cr("Heap:"); 156 print_extended_on(st); 157 st->cr(); | 105 MetaspaceUtils::used_bytes(), 106 MetaspaceUtils::reserved_bytes()); 107 const MetaspaceSizes data_space( 108 MetaspaceUtils::committed_bytes(Metaspace::NonClassType), 109 MetaspaceUtils::used_bytes(Metaspace::NonClassType), 110 MetaspaceUtils::reserved_bytes(Metaspace::NonClassType)); 111 const MetaspaceSizes class_space( 112 MetaspaceUtils::committed_bytes(Metaspace::ClassType), 113 MetaspaceUtils::used_bytes(Metaspace::ClassType), 114 MetaspaceUtils::reserved_bytes(Metaspace::ClassType)); 115 116 const MetaspaceChunkFreeListSummary& ms_chunk_free_list_summary = 117 MetaspaceUtils::chunk_free_list_summary(Metaspace::NonClassType); 118 const MetaspaceChunkFreeListSummary& class_chunk_free_list_summary = 119 MetaspaceUtils::chunk_free_list_summary(Metaspace::ClassType); 120 121 return MetaspaceSummary(MetaspaceGC::capacity_until_GC(), meta_space, data_space, class_space, 122 ms_chunk_free_list_summary, class_chunk_free_list_summary); 123 } 124 125 void CollectedHeap::print_heap_before_gc() { 126 Universe::print_heap_before_gc(); 127 if (_gc_heap_log != NULL) { 128 _gc_heap_log->log_heap_before(this); 129 } 130 } 131 132 void CollectedHeap::print_heap_after_gc() { 133 Universe::print_heap_after_gc(); 134 if (_gc_heap_log != NULL) { 135 _gc_heap_log->log_heap_after(this); 136 } 137 } 138 139 void CollectedHeap::print() const { print_on(tty); } 140 141 void CollectedHeap::print_on_error(outputStream* st) const { 142 st->print_cr("Heap:"); 143 print_extended_on(st); 144 st->cr(); |