-
Enhancement
-
Resolution: Unresolved
-
P4
-
15
When determining to expand the heap G1 uses a sliding window approach to determine whether it should expand the heap or not as one of its factors.
E.g. if there were at least 4 (MinOverThresholdForGrowth) occurrences of not met gctimeratio within the last 10 (NumPrevPausesForHeuristics) checks.
However this check is not entirely correct in that the sliding window implementation is not sliding, i.e. while it starts counting on the first occurrence of an exceeded gc time ratio, it resets the number of recent occurrences of being over gctimeratio (and the window) after NumPrevPausesForHeuristics entries.
I.e. it only triggers if the number of occurrences of being over gctimeratio is over the threshold within exactly every 10 gcs.
E.g. Y N Y N N N N N N Y | Y N Y N Y N N N N N | ... would not trigger (Y = current gctime ratio over ratio, N = not, | = window boundary), although the number of occurrences of being over the threshold is above 4 in some of the time windows.
E.g. if there were at least 4 (MinOverThresholdForGrowth) occurrences of not met gctimeratio within the last 10 (NumPrevPausesForHeuristics) checks.
However this check is not entirely correct in that the sliding window implementation is not sliding, i.e. while it starts counting on the first occurrence of an exceeded gc time ratio, it resets the number of recent occurrences of being over gctimeratio (and the window) after NumPrevPausesForHeuristics entries.
I.e. it only triggers if the number of occurrences of being over gctimeratio is over the threshold within exactly every 10 gcs.
E.g. Y N Y N N N N N N Y | Y N Y N Y N N N N N | ... would not trigger (Y = current gctime ratio over ratio, N = not, | = window boundary), although the number of occurrences of being over the threshold is above 4 in some of the time windows.