src/share/vm/services/memoryManager.cpp

Print this page
rev 4210 : 8000754: NPG: Implement a MemoryPool MXBean for Metaspace


  44 #endif /* !USDT2 */
  45 
  46 MemoryManager::MemoryManager() {
  47   _num_pools = 0;
  48   _memory_mgr_obj = NULL;
  49 }
  50 
  51 void MemoryManager::add_pool(MemoryPool* pool) {
  52   assert(_num_pools < MemoryManager::max_num_pools, "_num_pools exceeds the max");
  53   if (_num_pools < MemoryManager::max_num_pools) {
  54     _pools[_num_pools] = pool;
  55     _num_pools++;
  56   }
  57   pool->add_manager(this);
  58 }
  59 
  60 MemoryManager* MemoryManager::get_code_cache_memory_manager() {
  61   return (MemoryManager*) new CodeCacheMemoryManager();
  62 }
  63 




  64 GCMemoryManager* MemoryManager::get_copy_memory_manager() {
  65   return (GCMemoryManager*) new CopyMemoryManager();
  66 }
  67 
  68 GCMemoryManager* MemoryManager::get_msc_memory_manager() {
  69   return (GCMemoryManager*) new MSCMemoryManager();
  70 }
  71 
  72 GCMemoryManager* MemoryManager::get_parnew_memory_manager() {
  73   return (GCMemoryManager*) new ParNewMemoryManager();
  74 }
  75 
  76 GCMemoryManager* MemoryManager::get_cms_memory_manager() {
  77   return (GCMemoryManager*) new CMSMemoryManager();
  78 }
  79 
  80 GCMemoryManager* MemoryManager::get_psScavenge_memory_manager() {
  81   return (GCMemoryManager*) new PSScavengeMemoryManager();
  82 }
  83 




  44 #endif /* !USDT2 */
  45 
  46 MemoryManager::MemoryManager() {
  47   _num_pools = 0;
  48   _memory_mgr_obj = NULL;
  49 }
  50 
  51 void MemoryManager::add_pool(MemoryPool* pool) {
  52   assert(_num_pools < MemoryManager::max_num_pools, "_num_pools exceeds the max");
  53   if (_num_pools < MemoryManager::max_num_pools) {
  54     _pools[_num_pools] = pool;
  55     _num_pools++;
  56   }
  57   pool->add_manager(this);
  58 }
  59 
  60 MemoryManager* MemoryManager::get_code_cache_memory_manager() {
  61   return (MemoryManager*) new CodeCacheMemoryManager();
  62 }
  63 
  64 MemoryManager* MemoryManager::get_metaspace_memory_manager() {
  65   return (MemoryManager*) new MetaspaceMemoryManager();
  66 }
  67 
  68 GCMemoryManager* MemoryManager::get_copy_memory_manager() {
  69   return (GCMemoryManager*) new CopyMemoryManager();
  70 }
  71 
  72 GCMemoryManager* MemoryManager::get_msc_memory_manager() {
  73   return (GCMemoryManager*) new MSCMemoryManager();
  74 }
  75 
  76 GCMemoryManager* MemoryManager::get_parnew_memory_manager() {
  77   return (GCMemoryManager*) new ParNewMemoryManager();
  78 }
  79 
  80 GCMemoryManager* MemoryManager::get_cms_memory_manager() {
  81   return (GCMemoryManager*) new CMSMemoryManager();
  82 }
  83 
  84 GCMemoryManager* MemoryManager::get_psScavenge_memory_manager() {
  85   return (GCMemoryManager*) new PSScavengeMemoryManager();
  86 }
  87