Skip to content

8383892: Shenandoah: Decouple allocation rate sampling from GC cycle#31047

Open
earthling-amzn wants to merge 57 commits intoopenjdk:masterfrom
earthling-amzn:weighted-truncated-seq
Open

8383892: Shenandoah: Decouple allocation rate sampling from GC cycle#31047
earthling-amzn wants to merge 57 commits intoopenjdk:masterfrom
earthling-amzn:weighted-truncated-seq

Conversation

@earthling-amzn
Copy link
Copy Markdown
Contributor

@earthling-amzn earthling-amzn commented May 5, 2026

TL;DR;

The idea for this change started way back during the discussion of https://git.openjdk.org/jdk/pull/27398. I have been nursing the branch along for many months. The accelerated triggers PR threw it for a loop, but I have recently found the time to work through those changes.

  • The bytes_allocated_since_last_gc and all of its usages are removed
  • The old statistical based spike detector is removed
  • Tracking gc times and allocation rates share a common ShenandoahWeightedSeq now

Motivation

Presently, Shenandoah accumulates allocations in a bytes_allocated_since_last_gc variable. Although it is sampled periodically, it is only reset when a gc cycles runs. Correctly managing this variable has proven to be complicated:

This approach leads to inconsistent allocation rate samples and predictions, and code complexity.

This task decouples the management of the allocation accumulation and sampling from GC cycles and moves it to the allocation thread.

Results

Consider these critical_jops results from specjbb 2015 on a small (10g) heap:

                               Category | Count | Total | GeoMean | Average | Trim 0.1 | StdDev | Minimum | Maximum
    control/small/genshen critical_jops | 6 | 43673.000 | 7278.234 | 7278.833 | 7278.833 | 102.597 | 7177.000 | 7409.000
  treatment/small/genshen critical_jops | 4 | 31176.000 | 7793.102 | 7794.000 | 7794.000 | 137.193 | 7698.000 | 7989.000
       control/small/shen critical_jops | 6 | 45773.000 | 7627.889 | 7628.833 | 7628.833 | 131.119 | 7409.000 | 7800.000
     treatment/small/shen critical_jops | 4 | 31391.000 | 7847.140 | 7847.750 | 7847.750 | 113.500 | 7791.000 | 8018.000

On a medium (30g) heap:

                               Category | Count | Total | GeoMean | Average | Trim 0.1 | StdDev | Minimum | Maximum
   control/medium/genshen critical_jops | 6 | 101680.000 | 16943.068 | 16946.667 | 16946.667 | 383.252 | 16564.000 | 17401.000
 treatment/medium/genshen critical_jops | 4 | 71153.000 | 17773.961 | 17788.250 | 17788.250 | 825.516 | 16911.000 | 18810.000
      control/medium/shen critical_jops | 6 | 104370.000 | 17383.564 | 17395.000 | 17395.000 | 698.918 | 16911.000 | 18603.000
    treatment/medium/shen critical_jops | 4 | 75240.000 | 18810.000 | 18810.000 | 18810.000 | 0.000 | 18810.000 | 18810.000

p100 latency measurements on the Extremem benchmark are also improved.


  • I confirm that I make this contribution in accordance with the OpenJDK Interim AI Policy.
  • I made this code with my own bare hands.

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-8383892: Shenandoah: Decouple allocation rate sampling from GC cycle (Sub-task - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31047

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

Using diff file

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

Using Webrev

Link to Webrev Comment

…facilitate comparison with existing sampling
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 5, 2026

👋 Welcome back wkemper! 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
Copy link
Copy Markdown

openjdk Bot commented May 5, 2026

❗ 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 May 5, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 5, 2026

@earthling-amzn 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
Copy link
Copy Markdown

openjdk Bot commented May 5, 2026

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 May 6, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 6, 2026

Webrevs

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 rfr Pull request is ready for review shenandoah shenandoah-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

1 participant