comparison src/share/vm/memory/collectorPolicy.hpp @ 13059:46d7652b223c

8026853: Prepare GC code for collector policy regression fix Summary: Cleanup related to the NewSize and MaxNewSize bugs Reviewed-by: tschatzl, jcoomes, ehelin
author jwilhelm
date Mon, 21 Oct 2013 18:56:20 +0200
parents 4288e54fd145
children 8f07aa079343
comparison
equal deleted inserted replaced
13058:3aee6bc29547 13059:46d7652b223c
77 AdaptiveSizePolicy* _size_policy; 77 AdaptiveSizePolicy* _size_policy;
78 78
79 // Set to true when policy wants soft refs cleared. 79 // Set to true when policy wants soft refs cleared.
80 // Reset to false by gc after it clears all soft refs. 80 // Reset to false by gc after it clears all soft refs.
81 bool _should_clear_all_soft_refs; 81 bool _should_clear_all_soft_refs;
82
82 // Set to true by the GC if the just-completed gc cleared all 83 // Set to true by the GC if the just-completed gc cleared all
83 // softrefs. This is set to true whenever a gc clears all softrefs, and 84 // softrefs. This is set to true whenever a gc clears all softrefs, and
84 // set to false each time gc returns to the mutator. For example, in the 85 // set to false each time gc returns to the mutator. For example, in the
85 // ParallelScavengeHeap case the latter would be done toward the end of 86 // ParallelScavengeHeap case the latter would be done toward the end of
86 // mem_allocate() where it returns op.result() 87 // mem_allocate() where it returns op.result()
99 100
100 public: 101 public:
101 // Return maximum heap alignment that may be imposed by the policy 102 // Return maximum heap alignment that may be imposed by the policy
102 static size_t compute_max_alignment(); 103 static size_t compute_max_alignment();
103 104
104 size_t min_alignment() { return _min_alignment; } 105 size_t min_alignment() { return _min_alignment; }
105 size_t max_alignment() { return _max_alignment; } 106 size_t max_alignment() { return _max_alignment; }
106 107
107 size_t initial_heap_byte_size() { return _initial_heap_byte_size; } 108 size_t initial_heap_byte_size() { return _initial_heap_byte_size; }
108 size_t max_heap_byte_size() { return _max_heap_byte_size; } 109 size_t max_heap_byte_size() { return _max_heap_byte_size; }
109 size_t min_heap_byte_size() { return _min_heap_byte_size; } 110 size_t min_heap_byte_size() { return _min_heap_byte_size; }
110 111
246 size_t initial_gen0_size() { return _initial_gen0_size; } 247 size_t initial_gen0_size() { return _initial_gen0_size; }
247 size_t max_gen0_size() { return _max_gen0_size; } 248 size_t max_gen0_size() { return _max_gen0_size; }
248 249
249 virtual int number_of_generations() = 0; 250 virtual int number_of_generations() = 0;
250 251
251 virtual GenerationSpec **generations() { 252 virtual GenerationSpec **generations() {
252 assert(_generations != NULL, "Sanity check"); 253 assert(_generations != NULL, "Sanity check");
253 return _generations; 254 return _generations;
254 } 255 }
255 256
256 virtual GenCollectorPolicy* as_generation_policy() { return this; } 257 virtual GenCollectorPolicy* as_generation_policy() { return this; }
271 272
272 // Adaptive size policy 273 // Adaptive size policy
273 virtual void initialize_size_policy(size_t init_eden_size, 274 virtual void initialize_size_policy(size_t init_eden_size,
274 size_t init_promo_size, 275 size_t init_promo_size,
275 size_t init_survivor_size); 276 size_t init_survivor_size);
277
278 // The alignment used for eden and survivors within the young gen
279 // and for boundary between young gen and old gen.
280 static size_t intra_heap_alignment() {
281 return 64 * K * HeapWordSize;
282 }
276 }; 283 };
277 284
278 // All of hotspot's current collectors are subtypes of this 285 // All of hotspot's current collectors are subtypes of this
279 // class. Currently, these collectors all use the same gen[0], 286 // class. Currently, these collectors all use the same gen[0],
280 // but have different gen[1] types. If we add another subtype 287 // but have different gen[1] types. If we add another subtype
298 size_t max_gen1_size() { return _max_gen1_size; } 305 size_t max_gen1_size() { return _max_gen1_size; }
299 306
300 // Inherited methods 307 // Inherited methods
301 TwoGenerationCollectorPolicy* as_two_generation_policy() { return this; } 308 TwoGenerationCollectorPolicy* as_two_generation_policy() { return this; }
302 309
303 int number_of_generations() { return 2; } 310 int number_of_generations() { return 2; }
304 BarrierSet::Name barrier_set_name() { return BarrierSet::CardTableModRef; } 311 BarrierSet::Name barrier_set_name() { return BarrierSet::CardTableModRef; }
305 312
306 virtual CollectorPolicy::Name kind() { 313 virtual CollectorPolicy::Name kind() {
307 return CollectorPolicy::TwoGenerationCollectorPolicyKind; 314 return CollectorPolicy::TwoGenerationCollectorPolicyKind;
308 } 315 }
309 316