Skip to content

8388931: Shenandoah: Optimize ShenandoahHeapRegion footprint#32040

Draft
shipilev wants to merge 3 commits into
openjdk:masterfrom
shipilev:JDK-8388931-shenandoah-hr-footprint
Draft

8388931: Shenandoah: Optimize ShenandoahHeapRegion footprint#32040
shipilev wants to merge 3 commits into
openjdk:masterfrom
shipilev:JDK-8388931-shenandoah-hr-footprint

Conversation

@shipilev

@shipilev shipilev commented Jul 24, 2026

Copy link
Copy Markdown
Member

ShenandoahHeapRegion is known to be a performance critical instance in current GC code. Its storage is carefully managed to avoid (false) sharing across threads where possible, while keeping its footprint low.

We have organically regressed some of the ShenandoahHeapRegion footprint. It now takes a whooping 416 bytes, or 7x64-byte cache lines! We need to optimize this.

Additional testing:

  • Linux x86_64 server fastdebug, hotspot_gc_shenandoah
  • Regular testing pipelines


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8388931: Shenandoah: Optimize ShenandoahHeapRegion footprint (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32040/head:pull/32040
$ git checkout pull/32040

Update a local copy of the PR:
$ git checkout pull/32040
$ git pull https://git.openjdk.org/jdk.git pull/32040/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32040

View PR using the GUI difftool:
$ git pr show -t 32040

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32040.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 24, 2026

Copy link
Copy Markdown

👋 Welcome back shade! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jul 24, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Jul 24, 2026
@openjdk

openjdk Bot commented Jul 24, 2026

Copy link
Copy Markdown

@shipilev The following labels will be automatically applied to this pull request:

  • hotspot-gc
  • shenandoah

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk

openjdk Bot commented Jul 24, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-gc. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 24, 2026
@mlbridge

mlbridge Bot commented Jul 24, 2026

Copy link
Copy Markdown

Webrevs

@shipilev
shipilev marked this pull request as draft July 24, 2026 14:54
@openjdk openjdk Bot removed the rfr Pull request is ready for review label Jul 24, 2026
@shipilev

Copy link
Copy Markdown
Member Author

pahole now reports this:

        const HeapWord *           _bottom;              /*     0     8 */
        const HeapWord *           _end;                 /*     8     8 */
        const uint32_t             _index;               /*    16     4 */
        Atomic                     _state;               /*    20     4 */
        HeapWord *                 _new_top;             /*    24     8 */
        HeapWord *                 _top_before_promoted; /*    32     8 */
        HeapWord *                 _top_at_evac_start;   /*    40     8 */
        HeapWord *                 _coalesce_and_fill_boundary; /*    48     8 */
        size_t                     _mixed_candidate_garbage_words; /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        Atomic                     _live_data;           /*    64     8 */
        Atomic                     _critical_pins;       /*    72     8 */
        Atomic                     _update_watermark;    /*    80     8 */
        HeapWord *                 _top;                 /*    88     8 */
        uint32_t                   _tlab_allocs;         /*    96     4 */
        uint32_t                   _gclab_allocs;        /*   100     4 */
        uint32_t                   _plab_allocs;         /*   104     4 */
        float                      _empty_time;          /*   108     4 */
        Atomic                     _has_self_forwards;   /*   112     1 */
        Atomic                     _recycling;           /*   113     1 */
        uint8_t                    _age;                 /*   114     1 */
        bool                       _needs_bitmap_reset;  /*   115     1 */
        bool                       _promoted_in_place;   /*   116     1 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant