RFR: 8309639: [Shenandoah] Regression in LRU cache benchmark
William Kemper
wkemper at openjdk.org
Wed Aug 16 23:38:07 UTC 2023
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%).
-------------
Commit messages:
- Do not ignore learning cycles
Changes: https://git.openjdk.org/shenandoah/pull/307/files
Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=307&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8309639
Stats: 7 lines in 1 file changed: 3 ins; 3 del; 1 mod
Patch: https://git.openjdk.org/shenandoah/pull/307.diff
Fetch: git fetch https://git.openjdk.org/shenandoah.git pull/307/head:pull/307
PR: https://git.openjdk.org/shenandoah/pull/307
More information about the shenandoah-dev
mailing list