< prev index next >

src/hotspot/share/gc/cms/cmsHeap.cpp

Print this page




  47                                size_t max_size,
  48                                bool support_usage_threshold) :
  49     CollectedMemoryPool(name, space->capacity(), max_size, support_usage_threshold),
  50     _space(space) {
  51   }
  52 
  53   MemoryUsage get_memory_usage() {
  54     size_t max_heap_size   = (available_for_allocation() ? max_size() : 0);
  55     size_t used      = used_in_bytes();
  56     size_t committed = _space->capacity();
  57 
  58     return MemoryUsage(initial_size(), used, committed, max_heap_size);
  59   }
  60 
  61   size_t used_in_bytes() {
  62     return _space->used();
  63   }
  64 };
  65 
  66 CMSHeap::CMSHeap(GenCollectorPolicy *policy) :
  67   GenCollectedHeap(policy), _eden_pool(NULL), _survivor_pool(NULL), _old_pool(NULL) {





  68   _workers = new WorkGang("GC Thread", ParallelGCThreads,
  69                           /* are_GC_task_threads */true,
  70                           /* are_ConcurrentGC_threads */false);
  71   _workers->initialize_workers();
  72 }
  73 
  74 jint CMSHeap::initialize() {
  75   jint status = GenCollectedHeap::initialize();
  76   if (status != JNI_OK) return status;
  77 
  78   // If we are running CMS, create the collector responsible
  79   // for collecting the CMS generations.
  80   if (!create_cms_collector()) {
  81     return JNI_ENOMEM;
  82   }
  83 
  84   return JNI_OK;
  85 }
  86 
  87 void CMSHeap::initialize_serviceability() {




  47                                size_t max_size,
  48                                bool support_usage_threshold) :
  49     CollectedMemoryPool(name, space->capacity(), max_size, support_usage_threshold),
  50     _space(space) {
  51   }
  52 
  53   MemoryUsage get_memory_usage() {
  54     size_t max_heap_size   = (available_for_allocation() ? max_size() : 0);
  55     size_t used      = used_in_bytes();
  56     size_t committed = _space->capacity();
  57 
  58     return MemoryUsage(initial_size(), used, committed, max_heap_size);
  59   }
  60 
  61   size_t used_in_bytes() {
  62     return _space->used();
  63   }
  64 };
  65 
  66 CMSHeap::CMSHeap(GenCollectorPolicy *policy) :
  67     GenCollectedHeap(policy,
  68                      Generation::ParNew,
  69                      Generation::ConcurrentMarkSweep),
  70     _eden_pool(NULL),
  71     _survivor_pool(NULL),
  72     _old_pool(NULL) {
  73   _workers = new WorkGang("GC Thread", ParallelGCThreads,
  74                           /* are_GC_task_threads */true,
  75                           /* are_ConcurrentGC_threads */false);
  76   _workers->initialize_workers();
  77 }
  78 
  79 jint CMSHeap::initialize() {
  80   jint status = GenCollectedHeap::initialize();
  81   if (status != JNI_OK) return status;
  82 
  83   // If we are running CMS, create the collector responsible
  84   // for collecting the CMS generations.
  85   if (!create_cms_collector()) {
  86     return JNI_ENOMEM;
  87   }
  88 
  89   return JNI_OK;
  90 }
  91 
  92 void CMSHeap::initialize_serviceability() {


< prev index next >