Repository navigation
Conversation
jbachorik
force-pushed
the
investigate-reference-chains
branch
from
October 30, 2026 15:13
522ee15 to
9f0aeca
Compare
Contributor
CI Test ResultsRun: #41086952742 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-10-30 16:29:49 UTC |
jbachorik
force-pushed
the
reference-chain-pass-pacing
branch
from
October 30, 2026 15:36
ba98ff4 to
2ea5836
Compare
Add a minimum pass spacing gate ahead of every shouldRunPass authorization lane (GC epoch, canary back-to-back, fallback cadence), so pass rate tracks the pause controller's cadence instead of the young-GC rate. End a pass immediately on a truncated or errored root enumeration instead of retrying on the next pass, and gate retries on an adaptive interval: 2s floor, extended by 20ns per millisecond of measured in-safepoint cost, capped at 30s. IterateOverReachableObjects deoptimizes, on every thread, every compiled frame whose scope holds a scalar-replaced object, so root-enum frequency is the deopt-all storm's lever. Add debug-only *ForTest seams over the scheduling state and remove the unused setReferenceChainSearchStartedForTest0 seam.
jbachorik
force-pushed
the
reference-chain-pass-pacing
branch
from
October 30, 2026 15:39
4f26634 to
a6d7e06
Compare
Add ReferenceChainSchedulingTest over the spacing and root-enum gates (open and closed directions, positive controls for the negated probes, verified GC-epoch advancement). Backdate pass spacing in the canary-lane and refill gtests for the new gate; add boundary tests for the root-enum interval edge and the GC-epoch shift clamp. Share assumeDebugBuild() via ReferenceChainAssertions.
REFCHAINS_EASPIN=<n> starts workers holding scalar-replaced locals live across a loop back-edge, so root enumerations deoptimize their compiled frames and the deopt axis of the safepoint storm is reproducible locally. Document the variable in run-refchains-repro.sh.
jbachorik
force-pushed
the
reference-chain-pass-pacing
branch
from
October 30, 2026 16:07
a6d7e06 to
bc30ba4
Compare
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
Bounds the reference-chain collector's safepoint frequency. Two scheduler changes, stacked on #921:
shouldRunPass()): one gate ahead of every authorization lane — GC epoch, canary back-to-back (mult=1), fallback cadence — requiresnow - _last_pass_ns >= _effective_cadence_ns. A completed GC now makes a pass eligible; it no longer decides when. The pause controller still owns the cadence, so measured safepoint pain feeds back into the rate, and the OOM urgency ramp needs no exemption because it drives the same cadence.shouldRunRootEnum(), new): a truncated or errored root enumeration no longer retries on the very next pass. Every attempt waits outmax(2s, 20ns per measured in-safepoint cost-ms), capped at 30s. On HotSpot,IterateOverReachableObjectsunconditionally runsEscapeBarrier::deoptimize_objects_all_threads()(jvmtiTagMap.cpp:3455), so root-enum frequency is the forced-deoptimization storm's direct lever; the cost-scaled interval makes an expensive walk push the next one out proportionally.Also adds debug-only
*ForTestseams over the scheduling state (release builds keep no-op stubs), removes the unusedsetReferenceChainSearchStartedForTest0seam, and extendsresetSearchStateForTest()to reset the pacing state.Motivation:
On prof-analyzer (prod), the collector produced ~900 VM ops in 55s — 575
VM_DeoptimizeFrame+ 325VM_HeapWalkOperation, one safepoint every ~54ms. Two amplifiers: the GC-epoch gate authorized a pass before the cadence check (pass rate tracked the young-GC rate), and a truncated enumeration retried every pass, converting each pass into an unconditional deopt-all enumeration. Staging showed the same shape with zero leak candidates (frontier grown to 382k entries, 0 chains) — #921 stops the candidate-less search; this change bounds the frequency of what legitimately remains. Evidence and staging measurements: PROF-16384.Additional Notes:
_effective_cadence_ns(10ms–4s, PID-controlled) even when a leak signal is hot; root enumerations run at most once per 2s (more when costly). A truncated enumeration pass does no expansion that pass.REFCHAINS_EASPIN=4):DeoptimizeFrameops 260 → 73 per run, 0 in the no-worker control. Chain emission unchanged (17 = 17).How to test the change?:
ReferenceChainSchedulingTest(new): pins both gates in open and closed directions, with positive controls for the negated probes, verified GC-epoch advancement, and the native-constant mirrors; boundary tests cover the root-enum interval edge and the GC-epoch shift clamp.referenceChainsBfsTests.inc/referenceChainsOomTests.inc: canary-lane and refill tests backdate_last_pass_nsfor the new gate; new boundary tests.REFCHAINS_EASPIN=4 REFCHAINS_ARGS=firstpassbudget=1 utils/run-refchains-repro.sh <out.jfr> 90, then compareDeoptimizeFrame/HeapWalkOperationcounts in the safepoint log.:ddprof-lib:gtestDebug_referenceChains_ut,:ddprof-test:testDebug -Ptests=ReferenceChainSchedulingTest, full*ReferenceChain*suites,spotlessApply.For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.