RFR: 8348594: Shenandoah: Do not penalize for degeneration when not the fault of triggering heuristic [v5]
Kelvin Nilsen
kdnilsen at openjdk.org
Tue Feb 11 18:21:09 UTC 2025
> Shenandoah heuristics use a penalty mechanism to cause earlier GC triggers when recent concurrent GC cycles degenerate. Degeneration is a stop-the-world remediation that allows GC to catch up when mutator allocations fail during concurrent GC. The fact that we needed to degenerate indicates that we were overly optimistic in delaying the trigger that starts concurrent GC.
>
> We have observed that it is common for degenerated GC cycles to cascade upon each other. The condition that caused an initial degenerated cycle is often not fully resolved by the end of that degenerated cycle. For example, the application may be experiencing a phase change and the GC heuristics are not yet attuned to the new behavior. Furthermore, a degenerated GC may exacerbate the problem condition. During the stop-the-world pause imposed by the first degenerated GC, work continues to accumulate in the form of new client requests that are buffered in network sockets until the end of that degenerated GC.
>
> As originally implemented, each degeneration would "pile on" additional penalties. These penalties cause the GC frequency to continue to increase. And the expanding CPU load of GC makes it increasingly difficult for mutator threads to catchup. The large penalties accumulated while we are trying to resolve the problem linger long after the problem condition has been resolved.
>
> This change does not add further to the degeneration penalties if a new degenerated cycle occurs through no fault of the triggering mechanism. We only add the degeneration penalty if the reason we are now degenerating can be attributed to a consciously late trigger by the heuristic.
Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains nine additional commits since the last revision:
- Merge tag 'jdk-25+9' into eliminate-no-fault-degen-penalties
Added tag jdk-25+9 for changeset 30f71622
- Revert "Use generation size to determine expected free"
This reverts commit 94a32ebfe5fefcc0e899e09e6fbfc0585c62b4e0.
- Respond to reviewer feedback
- Use generation size to determine expected free
- Respond to reviewer feedback
- Fix white space
- Remove debug instrumentation
- Only penalize heuristic if heuristic responsible
If we degenerate through no fault of "late triggering", then do not
penalize the heuristic.
- Eliminate no-fault degen penalties
As originally implemented, we apply penalties to the triggering
heuristic every time we experience a degenerated cycle. This has the
effect of forcing GC triggers to spiral out of control. This commit
changes the penalty mechanism. When a degen happens through no fault of
the heuristic triggering mechanism, we do not pile on additional
penalties. Specifically, we consider that heuristic triggering is not
responsible for a degenerated cycle that is associated with a GC that
began immediately following the end of the previous GC cycle.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/23305/files
- new: https://git.openjdk.org/jdk/pull/23305/files/ee7fe689..3aabd4db
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=23305&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=23305&range=03-04
Stats: 43531 lines in 2988 files changed: 18658 ins; 14204 del; 10669 mod
Patch: https://git.openjdk.org/jdk/pull/23305.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23305/head:pull/23305
PR: https://git.openjdk.org/jdk/pull/23305
More information about the hotspot-gc-dev
mailing list