< prev index next >

src/hotspot/share/gc/shared/genCollectedHeap.hpp

Print this page

        

@@ -23,16 +23,16 @@
  */
 
 #ifndef SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
 #define SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
 
-#include "gc/shared/adaptiveSizePolicy.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/collectorPolicy.hpp"
 #include "gc/shared/generation.hpp"
 #include "gc/shared/softRefGenPolicy.hpp"
 
+class AdaptiveSizePolicy;
 class StrongRootsScope;
 class SubTasksDone;
 class WorkGang;
 
 // A "GenCollectedHeap" is a CollectedHeap that uses generational

@@ -71,10 +71,13 @@
   // The generational collector policy.
   GenCollectorPolicy* _gen_policy;
 
   SoftRefGenPolicy _soft_ref_gen_policy;
 
+  // The sizing of the heap is controlled by a sizing policy.
+  AdaptiveSizePolicy* _size_policy;
+
   // Indicates that the most recent previous incremental collection failed.
   // The flag is cleared when an action is taken that might clear the
   // condition that caused that incremental collection to fail.
   bool _incremental_collection_failed;
 

@@ -153,10 +156,14 @@
 public:
 
   // Returns JNI_OK on success
   virtual jint initialize();
 
+  void initialize_size_policy(size_t init_eden_size,
+                              size_t init_promo_size,
+                              size_t init_survivor_size);
+
   // Does operations required after initialization has been done.
   void post_initialize();
 
   Generation* young_gen() const { return _young_gen; }
   Generation* old_gen()   const { return _old_gen; }

@@ -171,11 +178,11 @@
 
   virtual SoftRefPolicy* soft_ref_policy() { return &_soft_ref_gen_policy; }
 
   // Adaptive size policy
   virtual AdaptiveSizePolicy* size_policy() {
-    return gen_policy()->size_policy();
+    return _size_policy;
   }
 
   // Return the (conservative) maximum heap alignment
   static size_t conservative_max_heap_alignment() {
     return Generation::GenGrain;
< prev index next >