src/share/vm/services/g1MemoryPool.cpp

changeset 3176
8229bd737950
parent 3170
114e52976463
child 3462
877914d90c57
     1.1 --- a/src/share/vm/services/g1MemoryPool.cpp	Thu Sep 22 10:57:37 2011 -0700
     1.2 +++ b/src/share/vm/services/g1MemoryPool.cpp	Fri Sep 23 16:07:49 2011 -0400
     1.3 @@ -32,56 +32,28 @@
     1.4  G1MemoryPoolSuper::G1MemoryPoolSuper(G1CollectedHeap* g1h,
     1.5                                       const char* name,
     1.6                                       size_t init_size,
     1.7 +                                     size_t max_size,
     1.8                                       bool support_usage_threshold) :
     1.9 -  _g1h(g1h), CollectedMemoryPool(name,
    1.10 -                                   MemoryPool::Heap,
    1.11 -                                   init_size,
    1.12 -                                   undefined_max(),
    1.13 -                                   support_usage_threshold) {
    1.14 +  _g1mm(g1h->g1mm()), CollectedMemoryPool(name,
    1.15 +                                          MemoryPool::Heap,
    1.16 +                                          init_size,
    1.17 +                                          max_size,
    1.18 +                                          support_usage_threshold) {
    1.19    assert(UseG1GC, "sanity");
    1.20  }
    1.21  
    1.22 -// See the comment at the top of g1MemoryPool.hpp
    1.23 -size_t G1MemoryPoolSuper::eden_space_committed(G1CollectedHeap* g1h) {
    1.24 -  return MAX2(eden_space_used(g1h), (size_t) HeapRegion::GrainBytes);
    1.25 -}
    1.26 -
    1.27 -// See the comment at the top of g1MemoryPool.hpp
    1.28 -size_t G1MemoryPoolSuper::eden_space_used(G1CollectedHeap* g1h) {
    1.29 -  return g1h->g1mm()->eden_space_used();
    1.30 -}
    1.31 -
    1.32 -// See the comment at the top of g1MemoryPool.hpp
    1.33 -size_t G1MemoryPoolSuper::survivor_space_committed(G1CollectedHeap* g1h) {
    1.34 -  return g1h->g1mm()->survivor_space_committed();
    1.35 -}
    1.36 -
    1.37 -// See the comment at the top of g1MemoryPool.hpp
    1.38 -size_t G1MemoryPoolSuper::survivor_space_used(G1CollectedHeap* g1h) {
    1.39 -  return g1h->g1mm()->survivor_space_used();
    1.40 -}
    1.41 -
    1.42 -// See the comment at the top of g1MemoryPool.hpp
    1.43 -size_t G1MemoryPoolSuper::old_space_committed(G1CollectedHeap* g1h) {
    1.44 -  return g1h->g1mm()->old_space_committed();
    1.45 -}
    1.46 -
    1.47 -// See the comment at the top of g1MemoryPool.hpp
    1.48 -size_t G1MemoryPoolSuper::old_space_used(G1CollectedHeap* g1h) {
    1.49 -  return g1h->g1mm()->old_space_used();
    1.50 -}
    1.51 -
    1.52  G1EdenPool::G1EdenPool(G1CollectedHeap* g1h) :
    1.53    G1MemoryPoolSuper(g1h,
    1.54                      "G1 Eden Space",
    1.55 -                    eden_space_committed(g1h), /* init_size */
    1.56 +                    g1h->g1mm()->eden_space_committed(), /* init_size */
    1.57 +                    _undefined_max,
    1.58                      false /* support_usage_threshold */) { }
    1.59  
    1.60  MemoryUsage G1EdenPool::get_memory_usage() {
    1.61    size_t initial_sz = initial_size();
    1.62    size_t max_sz     = max_size();
    1.63    size_t used       = used_in_bytes();
    1.64 -  size_t committed  = eden_space_committed(_g1h);
    1.65 +  size_t committed  = _g1mm->eden_space_committed();
    1.66  
    1.67    return MemoryUsage(initial_sz, used, committed, max_sz);
    1.68  }
    1.69 @@ -89,14 +61,15 @@
    1.70  G1SurvivorPool::G1SurvivorPool(G1CollectedHeap* g1h) :
    1.71    G1MemoryPoolSuper(g1h,
    1.72                      "G1 Survivor Space",
    1.73 -                    survivor_space_committed(g1h), /* init_size */
    1.74 +                    g1h->g1mm()->survivor_space_committed(), /* init_size */
    1.75 +                    _undefined_max,
    1.76                      false /* support_usage_threshold */) { }
    1.77  
    1.78  MemoryUsage G1SurvivorPool::get_memory_usage() {
    1.79    size_t initial_sz = initial_size();
    1.80    size_t max_sz     = max_size();
    1.81    size_t used       = used_in_bytes();
    1.82 -  size_t committed  = survivor_space_committed(_g1h);
    1.83 +  size_t committed  = _g1mm->survivor_space_committed();
    1.84  
    1.85    return MemoryUsage(initial_sz, used, committed, max_sz);
    1.86  }
    1.87 @@ -104,14 +77,15 @@
    1.88  G1OldGenPool::G1OldGenPool(G1CollectedHeap* g1h) :
    1.89    G1MemoryPoolSuper(g1h,
    1.90                      "G1 Old Gen",
    1.91 -                    old_space_committed(g1h), /* init_size */
    1.92 +                    g1h->g1mm()->old_space_committed(), /* init_size */
    1.93 +                    _undefined_max,
    1.94                      true /* support_usage_threshold */) { }
    1.95  
    1.96  MemoryUsage G1OldGenPool::get_memory_usage() {
    1.97    size_t initial_sz = initial_size();
    1.98    size_t max_sz     = max_size();
    1.99    size_t used       = used_in_bytes();
   1.100 -  size_t committed  = old_space_committed(_g1h);
   1.101 +  size_t committed  = _g1mm->old_space_committed();
   1.102  
   1.103    return MemoryUsage(initial_sz, used, committed, max_sz);
   1.104  }

mercurial