RFR: 8317755: G1: Periodic GC interval should test for the last whole heap GC [v2]

Thomas Schatzl tschatzl at openjdk.org
Mon Nov 13 10:32:00 UTC 2023


On Thu, 9 Nov 2023 12:50:58 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> > I think there is still a misconception with the current "periodic gcs" here: it is first and foremost thought to be applicable for catching the idle case with all its options (also consider cpu idle, do full or concurrent gc).
> 
> Yes, "idle case". This PR adds another option that lets users to further fine-tune what "idle case" is.
> 
> > This is the reason for the suggestion to phase out the current option `G1PeriodicGCInterval` to use a different name,
> 
> IMO, the cost/benefit for renaming flags is too high to be worthwhile here. It would add to further confusion for users, as we change more and more flags across JDK releases. I would argue that proposed scheme fits the existing amendments to the periodic GC configurations:
> 
>     1. `-XX:G1PeriodicGCInterval=X`: "do periodic GCs with this frequency, unless we had other GCs recently"
> 
>     2. `-XX:G1PeriodicGCSystemLoadThreshold=X`: "...except when the CPU load is this high"
> 
>     3. `-XX:+G1PeriodicGCCheckWholeHeap`: "...except when other GCs did not inspect the whole heap"

Doing periodic whole heap inspections to free resources should not be tied to some notion of "idle" (ideally gc would schedule them at that time, but that is another matter).

E.g. the problem mentioned in https://mail.openjdk.org/pipermail/hotspot-gc-dev/2020-March/028857.html is independent of idle cleanup. Same issue applies to finalizers/symbol table/etc (also written up in https://bugs.openjdk.org/browse/JDK-8213198).

As far as I understand your proposal, in combination with `-XX:G1PeriodicGCSystemLoadThreshold` g1 may then never trigger whole heap collections (and the expected cleanups). An application may be non-idle for days without the need for concurrent mark, accumulating cruft in these data structures that can only be cleaned out with a concurrent mark.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16107#issuecomment-1807888303


More information about the hotspot-gc-dev mailing list