comparison src/share/vm/gc_implementation/g1/g1MMUTracker.cpp @ 1088:3fc996d4edd2

6902303: G1: ScavengeALot should cause an incremental, rather than a full, collection Summary: ScavengeALot now causes an incremental (but possibly partially young, in the G1 sense) collection. Some such collections may be abandoned on account of MMU specs. Band-aided a native leak associated with abandoned pauses, as well as an MMU tracker overflow related to frequent scavenge events in the face of a large MMU denominator interval; the latter is protected by a product flag that defaults to false. Reviewed-by: tonyp
author ysr
date Thu, 19 Nov 2009 13:43:25 -0800
parents 89e0543e1737
children b81f3572f355
comparison
equal deleted inserted replaced
1087:23b9a8d315fc 1088:3fc996d4edd2
84 // OK, right now when we fill up we bomb out 84 // OK, right now when we fill up we bomb out
85 // there are a few ways of dealing with this "gracefully" 85 // there are a few ways of dealing with this "gracefully"
86 // increase the array size (:-) 86 // increase the array size (:-)
87 // remove the oldest entry (this might allow more GC time for 87 // remove the oldest entry (this might allow more GC time for
88 // the time slice than what's allowed) 88 // the time slice than what's allowed)
89 // concolidate the two entries with the minimum gap between them 89 // consolidate the two entries with the minimum gap between them
90 // (this mighte allow less GC time than what's allowed) 90 // (this might allow less GC time than what's allowed)
91 guarantee(0, "array full, currently we can't recover"); 91 guarantee(NOT_PRODUCT(ScavengeALot ||) G1ForgetfulMMUTracker,
92 "array full, currently we can't recover unless +G1ForgetfulMMUTracker");
93 // In the case where ScavengeALot is true, such overflow is not
94 // uncommon; in such cases, we can, without much loss of precision
95 // or performance (we are GC'ing most of the time anyway!),
96 // simply overwrite the oldest entry in the tracker: this
97 // is also the behaviour when G1ForgetfulMMUTracker is enabled.
98 _head_index = trim_index(_head_index + 1);
99 assert(_head_index == _tail_index, "Because we have a full circular buffer");
100 _tail_index = trim_index(_tail_index + 1);
101 } else {
102 _head_index = trim_index(_head_index + 1);
103 ++_no_entries;
92 } 104 }
93 _head_index = trim_index(_head_index + 1);
94 ++_no_entries;
95 _array[_head_index] = G1MMUTrackerQueueElem(start, end); 105 _array[_head_index] = G1MMUTrackerQueueElem(start, end);
96 } 106 }
97 107
98 // basically the _internal call does not remove expired entries 108 // basically the _internal call does not remove expired entries
99 // this is for trying things out in the future and a couple 109 // this is for trying things out in the future and a couple