RFR: JDK-8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio [v8]
Stefan Johansson
sjohanss at openjdk.java.net
Fri Mar 19 13:21:44 UTC 2021
On Thu, 18 Mar 2021 14:36:51 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> in `G1CollectedHeap::satisfy_failed_allocation` there is this comment:
>
> ```
> // Attempts to allocate followed by Full GC that will collect all soft references.
> ```
>
> That would be the start of this "last-ditch" collection. At this point it may be possible to use the `clear_all_soft_references` as indication that we should be maximally compacting in that full gc. You would need to check if a full GC with that flag set to true is always a "maximally compacting collection" (there is one path with a comment indicating that this is intended). If that is the case (idk, I haven't looked all paths), then it would be appropriate to rename that parameter to something like `do_maximal_compaction` everywhere.
I think this sounds like a good approach as well, renaming the second parameter of `do_full_collection(bool, bool)` to something like that. Then I think we might want to add a new bool parameter to the `G1FullCollector` constructor to signal if this should be a "maximum" compaction. I think this is needed since we in `do_full_collection()` also is considering the `soft_ref_policy()` for what to do with references.
Then when constructing the `G1FullCollector` we can use this to set what "compaction level" we should use. I think a good place to store this would be in the `G1FullGCScope`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2760
More information about the hotspot-gc-dev
mailing list