--- a/hotspot/src/share/vm/services/memoryService.cpp Wed Mar 20 12:27:03 2013 -0700
+++ b/hotspot/src/share/vm/services/memoryService.cpp Fri Mar 22 16:10:01 2013 +0100
@@ -60,9 +60,11 @@
GrowableArray<MemoryManager*>* MemoryService::_managers_list =
new (ResourceObj::C_HEAP, mtInternal) GrowableArray<MemoryManager*>(init_managers_list_size, true);
-GCMemoryManager* MemoryService::_minor_gc_manager = NULL;
-GCMemoryManager* MemoryService::_major_gc_manager = NULL;
-MemoryPool* MemoryService::_code_heap_pool = NULL;
+GCMemoryManager* MemoryService::_minor_gc_manager = NULL;
+GCMemoryManager* MemoryService::_major_gc_manager = NULL;
+MemoryPool* MemoryService::_code_heap_pool = NULL;
+MemoryPool* MemoryService::_metaspace_pool = NULL;
+MemoryPool* MemoryService::_class_metaspace_pool = NULL;
class GcThreadCountClosure: public ThreadClosure {
private:
@@ -398,6 +400,19 @@
_managers_list->append(mgr);
}
+void MemoryService::add_metaspace_memory_pools() {
+ _metaspace_pool = new MetaspacePool();
+ _class_metaspace_pool = new ClassMetaspacePool();
+
+ MemoryManager* mgr = MemoryManager::get_metaspace_memory_manager();
+ mgr->add_pool(_metaspace_pool);
+ mgr->add_pool(_class_metaspace_pool);
+
+ _pools_list->append(_metaspace_pool);
+ _pools_list->append(_class_metaspace_pool);
+ _managers_list->append(mgr);
+}
+
MemoryManager* MemoryService::get_memory_manager(instanceHandle mh) {
for (int i = 0; i < _managers_list->length(); i++) {
MemoryManager* mgr = _managers_list->at(i);