RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet

Kelvin Nilsen kdnilsen at openjdk.org
Tue Sep 9 21:02:15 UTC 2025


On Wed, 20 Aug 2025 19:17:48 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet.  In the new code, we keep a single tally of relevant information within ShenandoahFreeSet.
> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet.
> 
> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies.  These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms.
> 
> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books.

This code now passes all internal CI tests.

The attached shows  some performance results on a SpecJBB workload for Generational Shenandoah and Traditional Shenandoah.  We see general improvements.  This presumably results from not having to maintain two synchronization mechanisms for two separate sets of "books".

<img width="369" height="139" alt="Screenshot 2025-09-09 at 1 53 53 PM" src="https://github.com/user-attachments/assets/c656c775-c710-48fd-975e-07e45156aa48" />

<img width="369" height="139" alt="Screenshot 2025-09-09 at 1 55 06 PM" src="https://github.com/user-attachments/assets/b2097fb6-82cf-4b7b-a37a-6b44acb44d7e" />

We also see general improvement running an Extremem workload.

<img width="1736" height="682" alt="Screenshot 2025-09-09 at 1 56 02 PM" src="https://github.com/user-attachments/assets/65e68ec7-5ead-4f38-b49a-2d625ab81ec4" />

Analysis of these results has revealed a shortcoming in the Generational version of Final Update Refs safepoint, which accounts for the higher p99.999 and p100 latencies of GenShen compared to Shen.  In a separate PR, we will be moving the Flush SATB buffer action out of the safepoint, performing this work in a handshake instead.

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

PR Comment: https://git.openjdk.org/jdk/pull/26867#issuecomment-3272248200


More information about the hotspot-gc-dev mailing list