src/hotspot/share/gc/g1/g1MemoryPool.cpp
changeset 51498 9a5200b84046
parent 51332 c25572739e7c
child 51625 c265860d5d45
--- a/src/hotspot/share/gc/g1/g1MemoryPool.cpp	Wed Aug 22 20:37:07 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1MemoryPool.cpp	Wed Aug 22 20:37:07 2018 +0200
@@ -40,50 +40,41 @@
   assert(UseG1GC, "sanity");
 }
 
-G1EdenPool::G1EdenPool(G1CollectedHeap* g1h) :
+G1EdenPool::G1EdenPool(G1CollectedHeap* g1h, size_t initial_size) :
   G1MemoryPoolSuper(g1h,
                     "G1 Eden Space",
-                    g1h->g1mm()->eden_space_committed(), /* init_size */
-                    _undefined_max,
+                    initial_size,
+                    MemoryUsage::undefined_size(),
                     false /* support_usage_threshold */) { }
 
 MemoryUsage G1EdenPool::get_memory_usage() {
-  size_t initial_sz = initial_size();
-  size_t max_sz     = max_size();
-  size_t used       = used_in_bytes();
   size_t committed  = _g1mm->eden_space_committed();
 
-  return MemoryUsage(initial_sz, used, committed, max_sz);
+  return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size());
 }
 
-G1SurvivorPool::G1SurvivorPool(G1CollectedHeap* g1h) :
+G1SurvivorPool::G1SurvivorPool(G1CollectedHeap* g1h, size_t initial_size) :
   G1MemoryPoolSuper(g1h,
                     "G1 Survivor Space",
-                    g1h->g1mm()->survivor_space_committed(), /* init_size */
-                    _undefined_max,
+                    initial_size,
+                    MemoryUsage::undefined_size(),
                     false /* support_usage_threshold */) { }
 
 MemoryUsage G1SurvivorPool::get_memory_usage() {
-  size_t initial_sz = initial_size();
-  size_t max_sz     = max_size();
-  size_t used       = used_in_bytes();
   size_t committed  = _g1mm->survivor_space_committed();
 
-  return MemoryUsage(initial_sz, used, committed, max_sz);
+  return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size());
 }
 
-G1OldGenPool::G1OldGenPool(G1CollectedHeap* g1h) :
+G1OldGenPool::G1OldGenPool(G1CollectedHeap* g1h, size_t initial_size, size_t max_size) :
   G1MemoryPoolSuper(g1h,
                     "G1 Old Gen",
-                    g1h->g1mm()->old_space_committed(), /* init_size */
-                    g1h->g1mm()->old_gen_max(),
+                    initial_size,
+                    max_size,
                     true /* support_usage_threshold */) { }
 
 MemoryUsage G1OldGenPool::get_memory_usage() {
-  size_t initial_sz = initial_size();
-  size_t max_sz     = max_size();
-  size_t used       = used_in_bytes();
-  size_t committed  = _g1mm->old_space_committed();
+  size_t committed  = _g1mm->old_gen_committed();
 
-  return MemoryUsage(initial_sz, used, committed, max_sz);
+  return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size());
 }