< prev index next >

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

Print this page




  45 private:
  46   CompactibleFreeListSpace* _space;
  47 public:
  48   CompactibleFreeListSpacePool(CompactibleFreeListSpace* space,
  49                                const char* name,
  50                                size_t max_size,
  51                                bool support_usage_threshold) :
  52     CollectedMemoryPool(name, space->capacity(), max_size, support_usage_threshold),
  53     _space(space) {
  54   }
  55 
  56   MemoryUsage get_memory_usage() {
  57     size_t max_heap_size   = (available_for_allocation() ? max_size() : 0);
  58     size_t used      = used_in_bytes();
  59     size_t committed = _space->capacity();
  60 
  61     return MemoryUsage(initial_size(), used, committed, max_heap_size);
  62   }
  63 
  64   size_t used_in_bytes() {
  65     return _space->used_stable();
  66   }
  67 };
  68 
  69 CMSHeap::CMSHeap() :
  70     GenCollectedHeap(Generation::ParNew,
  71                      Generation::ConcurrentMarkSweep,
  72                      "ParNew:CMS"),
  73     _workers(NULL),
  74     _eden_pool(NULL),
  75     _survivor_pool(NULL),
  76     _old_pool(NULL) {
  77 }
  78 
  79 jint CMSHeap::initialize() {
  80   jint status = GenCollectedHeap::initialize();
  81   if (status != JNI_OK) return status;
  82 
  83   _workers = new WorkGang("GC Thread", ParallelGCThreads,
  84                           /* are_GC_task_threads */true,
  85                           /* are_ConcurrentGC_threads */false);




  45 private:
  46   CompactibleFreeListSpace* _space;
  47 public:
  48   CompactibleFreeListSpacePool(CompactibleFreeListSpace* space,
  49                                const char* name,
  50                                size_t max_size,
  51                                bool support_usage_threshold) :
  52     CollectedMemoryPool(name, space->capacity(), max_size, support_usage_threshold),
  53     _space(space) {
  54   }
  55 
  56   MemoryUsage get_memory_usage() {
  57     size_t max_heap_size   = (available_for_allocation() ? max_size() : 0);
  58     size_t used      = used_in_bytes();
  59     size_t committed = _space->capacity();
  60 
  61     return MemoryUsage(initial_size(), used, committed, max_heap_size);
  62   }
  63 
  64   size_t used_in_bytes() {
  65     return _space->used();
  66   }
  67 };
  68 
  69 CMSHeap::CMSHeap() :
  70     GenCollectedHeap(Generation::ParNew,
  71                      Generation::ConcurrentMarkSweep,
  72                      "ParNew:CMS"),
  73     _workers(NULL),
  74     _eden_pool(NULL),
  75     _survivor_pool(NULL),
  76     _old_pool(NULL) {
  77 }
  78 
  79 jint CMSHeap::initialize() {
  80   jint status = GenCollectedHeap::initialize();
  81   if (status != JNI_OK) return status;
  82 
  83   _workers = new WorkGang("GC Thread", ParallelGCThreads,
  84                           /* are_GC_task_threads */true,
  85                           /* are_ConcurrentGC_threads */false);


< prev index next >