Currently G1 maintains collection set candidates from the marking phase (where it determines those) until the end of the mixed gc phase.
Mixed gc phase ends when the amount of space that can be reclaimed in the java heap with the remaining collection set candidates is smaller than G1HeapWastePercent of the (current) heap capacity.
This means that in some cases a significant amount of memory is used for regions that will never be evacuated. In addition to that, maintaining the remembered sets for these never evacuated regions uses execution time and more memory for the remembered set.
In fact, in some cases, it can happen that in the first few mixed gcs of a mixed gc phase, remembered set memory consumption *increases* even though the remembered sets of recently evacuated old gen regions are freed.
The proposed alternative is to prune the collection set candidates as early as possible, filtering out regions that are never going to be evacuated (or have a very low probability).
In some cases doing this can save half of peak remembered set memory usage.
Mixed gc phase ends when the amount of space that can be reclaimed in the java heap with the remaining collection set candidates is smaller than G1HeapWastePercent of the (current) heap capacity.
This means that in some cases a significant amount of memory is used for regions that will never be evacuated. In addition to that, maintaining the remembered sets for these never evacuated regions uses execution time and more memory for the remembered set.
In fact, in some cases, it can happen that in the first few mixed gcs of a mixed gc phase, remembered set memory consumption *increases* even though the remembered sets of recently evacuated old gen regions are freed.
The proposed alternative is to prune the collection set candidates as early as possible, filtering out regions that are never going to be evacuated (or have a very low probability).
In some cases doing this can save half of peak remembered set memory usage.
- duplicates
-
JDK-7146242 G1: alternative heuristic on deciding which old regions not to collect
- Closed
- relates to
-
JDK-8286467 G1: Collection set pruning adds one region too many
- Resolved
-
JDK-8017163 G1: Refactor remembered sets
- Resolved
-
JDK-8180415 Rebuild remembered sets during the concurrent cycle
- Resolved
-
JDK-8331048 G1: Prune rebuild candidates based on G1HeapWastePercent early
- Resolved
(2 links to)