Currently the flags
G1HeapWastePercent
G1MixedGCLiveThresholdPercent
G1OldCSetRegionThresholdPercent
G1MixedGCLiveThresholdPercent and
G1MixedGCCountTarget
determine the length of the mixed gc phase and the candidate selection.
Try to make them more adaptive in the sense of
- if we can't reclaim more than we promote for some time, either adjust settings (increase pause time goal, increase minimum number of old regions to get) or give up
- if we are close to going out of heap, increase the candidate set, and relax the requirements
- if there is enough time (e.g. gc overhead), clean out more (or slower)
Of course, the inverse of these conditions (if applicable) is true as well