< prev index next >

src/share/vm/services/memoryManager.cpp

Print this page




  83 GCMemoryManager* MemoryManager::get_cms_memory_manager() {
  84   return (GCMemoryManager*) new CMSMemoryManager();
  85 }
  86 
  87 GCMemoryManager* MemoryManager::get_psScavenge_memory_manager() {
  88   return (GCMemoryManager*) new PSScavengeMemoryManager();
  89 }
  90 
  91 GCMemoryManager* MemoryManager::get_psMarkSweep_memory_manager() {
  92   return (GCMemoryManager*) new PSMarkSweepMemoryManager();
  93 }
  94 
  95 GCMemoryManager* MemoryManager::get_g1YoungGen_memory_manager() {
  96   return (GCMemoryManager*) new G1YoungGenMemoryManager();
  97 }
  98 
  99 GCMemoryManager* MemoryManager::get_g1OldGen_memory_manager() {
 100   return (GCMemoryManager*) new G1OldGenMemoryManager();
 101 }
 102 








 103 instanceOop MemoryManager::get_memory_manager_instance(TRAPS) {
 104   // Must do an acquire so as to force ordering of subsequent
 105   // loads from anything _memory_mgr_obj points to or implies.
 106   instanceOop mgr_obj = (instanceOop)OrderAccess::load_ptr_acquire(&_memory_mgr_obj);
 107   if (mgr_obj == NULL) {
 108     // It's ok for more than one thread to execute the code up to the locked region.
 109     // Extra manager instances will just be gc'ed.
 110     Klass* k = Management::sun_management_ManagementFactory_klass(CHECK_0);
 111     instanceKlassHandle ik(THREAD, k);
 112 
 113     Handle mgr_name = java_lang_String::create_from_str(name(), CHECK_0);
 114 
 115     JavaValue result(T_OBJECT);
 116     JavaCallArguments args;
 117     args.push_oop(mgr_name);    // Argument 1
 118 
 119     Symbol* method_name = NULL;
 120     Symbol* signature = NULL;
 121     if (is_gc_memory_manager()) {
 122       method_name = vmSymbols::createGarbageCollector_name();




  83 GCMemoryManager* MemoryManager::get_cms_memory_manager() {
  84   return (GCMemoryManager*) new CMSMemoryManager();
  85 }
  86 
  87 GCMemoryManager* MemoryManager::get_psScavenge_memory_manager() {
  88   return (GCMemoryManager*) new PSScavengeMemoryManager();
  89 }
  90 
  91 GCMemoryManager* MemoryManager::get_psMarkSweep_memory_manager() {
  92   return (GCMemoryManager*) new PSMarkSweepMemoryManager();
  93 }
  94 
  95 GCMemoryManager* MemoryManager::get_g1YoungGen_memory_manager() {
  96   return (GCMemoryManager*) new G1YoungGenMemoryManager();
  97 }
  98 
  99 GCMemoryManager* MemoryManager::get_g1OldGen_memory_manager() {
 100   return (GCMemoryManager*) new G1OldGenMemoryManager();
 101 }
 102 
 103 GCMemoryManager* MemoryManager::get_shenandoah_cycles_memory_manager() {
 104   return (GCMemoryManager*) new ShenandoahCyclesMemoryManager();
 105 }
 106 
 107 GCMemoryManager* MemoryManager::get_shenandoah_pauses_memory_manager() {
 108   return (GCMemoryManager*) new ShenandoahPausesMemoryManager();
 109 }
 110 
 111 instanceOop MemoryManager::get_memory_manager_instance(TRAPS) {
 112   // Must do an acquire so as to force ordering of subsequent
 113   // loads from anything _memory_mgr_obj points to or implies.
 114   instanceOop mgr_obj = (instanceOop)OrderAccess::load_ptr_acquire(&_memory_mgr_obj);
 115   if (mgr_obj == NULL) {
 116     // It's ok for more than one thread to execute the code up to the locked region.
 117     // Extra manager instances will just be gc'ed.
 118     Klass* k = Management::sun_management_ManagementFactory_klass(CHECK_0);
 119     instanceKlassHandle ik(THREAD, k);
 120 
 121     Handle mgr_name = java_lang_String::create_from_str(name(), CHECK_0);
 122 
 123     JavaValue result(T_OBJECT);
 124     JavaCallArguments args;
 125     args.push_oop(mgr_name);    // Argument 1
 126 
 127     Symbol* method_name = NULL;
 128     Symbol* signature = NULL;
 129     if (is_gc_memory_manager()) {
 130       method_name = vmSymbols::createGarbageCollector_name();


< prev index next >