RFR: 8309639: GenShen: Regression in LRU cache benchmark
Kelvin Nilsen
kdnilsen at openjdk.org
Thu Aug 17 19:07:15 UTC 2023
On Wed, 16 Aug 2023 23:31:33 GMT, William Kemper <wkemper at openjdk.org> wrote:
> Shenandoah's adaptive heuristic begins in a state where it is "learning" the application. In this state, it triggers collections somewhat more aggressively in an effort to "learn" the allocation rate and cycle times for the application.
>
> Shenandoah also has the ability to "skip" evacuation phases when marking finds sufficient garbage in regions with no live objects. We call these "abbreviated" cycles. During the course of development for the generational mode, we found that such cycles tend to decrease the average cycle time tracked by the heuristic. This in turn leads to the heuristic triggering a cycle "too late" - because it expects the cycle to take less time than a normal (i.e., not abbreviated) cycle requires. To address this, we modified the heuristic to not include abbreviated cycle times in the average cycle time.
>
> Unfortunately, this change also made the heuristic not count abbreviated cycles as "learning" cycles. Ordinarily, this is not a concern because the application will usually run plenty of "normal" cycles. However, we've discovered that the certain benchmarks and jtreg tests only run abbreviated cycles. This causes the heuristic to stay in the "learning" state for the duration of the benchmark. In this state, the GC is run more aggressively and performance suffers (15-20%).
This looks like a good compromise. Since this new code isn't in the "isolation audit", I don't want to lose track of the change. Should we make this conditional upon is_generational, and revert the non-generational mode to original behavior?
-------------
Marked as reviewed by kdnilsen (Committer).
PR Review: https://git.openjdk.org/shenandoah/pull/307#pullrequestreview-1583287453
More information about the shenandoah-dev
mailing list