comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 1283:1c72304f1885

6928073: G1: use existing command line parameters for marking cycle initiation Summary: replace the combination of the G1SteadyStateUsed / G1SteadyStateUsedDelta parameteres to decide the marking initiation threshold and instead use InitiatingHeapOccupancyPercent. Reviewed-by: ysr, johnc
author tonyp
date Tue, 23 Feb 2010 23:14:34 -0500
parents b81f3572f355
children a1c410de27e4
comparison
equal deleted inserted replaced
1282:b81f3572f355 1283:1c72304f1885
296 // Set aside an initial future to_space. 296 // Set aside an initial future to_space.
297 _g1 = G1CollectedHeap::heap(); 297 _g1 = G1CollectedHeap::heap();
298 size_t regions = Universe::heap()->capacity() / HeapRegion::GrainBytes; 298 size_t regions = Universe::heap()->capacity() / HeapRegion::GrainBytes;
299 299
300 assert(Heap_lock->owned_by_self(), "Locking discipline."); 300 assert(Heap_lock->owned_by_self(), "Locking discipline.");
301
302 if (G1SteadyStateUsed < 50) {
303 vm_exit_during_initialization("G1SteadyStateUsed must be at least 50%.");
304 }
305 301
306 initialize_gc_policy_counters(); 302 initialize_gc_policy_counters();
307 303
308 if (G1Gen) { 304 if (G1Gen) {
309 _in_young_gc_mode = true; 305 _in_young_gc_mode = true;
1423 last_pause_included_initial_mark = _should_initiate_conc_mark; 1419 last_pause_included_initial_mark = _should_initiate_conc_mark;
1424 if (last_pause_included_initial_mark) 1420 if (last_pause_included_initial_mark)
1425 record_concurrent_mark_init_end_pre(0.0); 1421 record_concurrent_mark_init_end_pre(0.0);
1426 1422
1427 size_t min_used_targ = 1423 size_t min_used_targ =
1428 (_g1->capacity() / 100) * (G1SteadyStateUsed - G1SteadyStateUsedDelta); 1424 (_g1->capacity() / 100) * InitiatingHeapOccupancyPercent;
1429 1425
1430 if (cur_used_bytes > min_used_targ) { 1426 if (cur_used_bytes > min_used_targ) {
1431 if (cur_used_bytes <= _prev_collection_pause_used_at_end_bytes) { 1427 if (cur_used_bytes <= _prev_collection_pause_used_at_end_bytes) {
1432 } else if (!_g1->mark_in_progress() && !_last_full_young_gc) { 1428 } else if (!_g1->mark_in_progress() && !_last_full_young_gc) {
1433 _should_initiate_conc_mark = true; 1429 _should_initiate_conc_mark = true;
2616 2612
2617 bool 2613 bool
2618 G1CollectorPolicy_BestRegionsFirst::should_do_collection_pause(size_t 2614 G1CollectorPolicy_BestRegionsFirst::should_do_collection_pause(size_t
2619 word_size) { 2615 word_size) {
2620 assert(_g1->regions_accounted_for(), "Region leakage!"); 2616 assert(_g1->regions_accounted_for(), "Region leakage!");
2621 // Initiate a pause when we reach the steady-state "used" target.
2622 size_t used_hard = (_g1->capacity() / 100) * G1SteadyStateUsed;
2623 size_t used_soft =
2624 MAX2((_g1->capacity() / 100) * (G1SteadyStateUsed - G1SteadyStateUsedDelta),
2625 used_hard/2);
2626 size_t used = _g1->used();
2627
2628 double max_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0; 2617 double max_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
2629 2618
2630 size_t young_list_length = _g1->young_list_length(); 2619 size_t young_list_length = _g1->young_list_length();
2631 size_t young_list_max_length = _young_list_target_length; 2620 size_t young_list_max_length = _young_list_target_length;
2632 if (G1FixedEdenSize) { 2621 if (G1FixedEdenSize) {