Conversation
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CI Test ResultsRun: #36589666352 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-09-29 16:00:48 UTC |
e8f5ee5 to
93f2dbf
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
93f2dbf to
217a7ab
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93f2dbf486
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Stopping a recording can omit all reference-chain events since the last dump. The lifecycle also keeps strong thread references and stale chain data across recording sessions.
🤖 Datadog Autotest · Commit 93f2dbf · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
217a7ab to
b5588b7
Compare
b5588b7 to
b09e78d
Compare
e99dbc2 to
61cfd3d
Compare
61cfd3d to
ac29386
Compare
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 2 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 1173f79 | Docs | View more details | Give us feedback! |
5f7ef97 to
2fbc79b
Compare
0ea51f4 to
b1068ad
Compare
b1068ad to
81cc197
Compare
f535cb7 to
a0b9eb2
Compare
Reliability & Chaos Results❌ 21 failure(s) detected Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/139231267 ❌ profiler tcmalloc amd64Xjit❌ profiler tcmalloc amd64Xmemory❌ profiler tracer gmalloc aarch64Xmemory❌ chaos: profiler gmalloc aarch64 21 0 3 temXchaos❌ chaos: profiler gmalloc aarch64 25 0 3 temXchaos❌ chaos: profiler gmalloc amd64 21 0 3 temXchaos❌ chaos: profiler gmalloc amd64 25 0 3 temXchaos❌ chaos: profiler jemalloc aarch64 25 0 3 temXchaos❌ chaos: profiler jemalloc amd64 21 0 3 temXchaos❌ chaos: profiler jemalloc amd64 25 0 3 temXchaos❌ chaos: profiler tcmalloc aarch64 21 0 3 temXchaos❌ chaos: profiler tcmalloc amd64 21 0 3 temXchaos❌ chaos: profiler tcmalloc amd64 25 0 3 temXchaos❌ chaos: profiler tracer gmalloc aarch64 21 0 3 temXchaos❌ chaos: profiler tracer gmalloc amd64 21 0 3 temXchaos❌ chaos: profiler tracer gmalloc amd64 25 0 3 temXchaos❌ chaos: profiler tracer jemalloc aarch64 21 0 3 temXchaos❌ chaos: profiler tracer jemalloc aarch64 25 0 3 temXchaos❌ chaos: profiler tracer jemalloc amd64 25 0 3 temXchaos❌ chaos: profiler tracer tcmalloc aarch64 21 0 3 temXchaos❌ chaos: profiler tracer tcmalloc amd64 25 0 3 temXchaos |
a0b9eb2 to
cdea008
Compare
cdea008 to
0b0f8d8
Compare
Introduces the ReferenceChainEvent/ReferenceChainAbandonedEvent payloads (event.h), their JFR metadata (jfrMetadata.*), and the FlightRecorder emission paths that serialize chain events into JFR recording buffers, including the constant-pool handling for per-hop edge labels. Emission is pull-style: profiler.cpp snapshots events and hands them to FlightRecorder; this layer does not depend on the tracker itself.
Review findings on the JFR plumbing layer: - MAX_REFERENCE_CHAIN_EVENT_HOPS was a fixed 4096, permitting a ~438 KB worst-case event (near-limit edge labels) against a ~61 KB recording buffer - the reservation flushed first but the margin underflowed, so the write ran past the buffer (debug assert, release corruption). The cap is now derived from RECORDING_BUFFER_LIMIT minus the event's fixed fields, divided by the per-hop worst case, so a full-cap event always fits. - Truncation dropped ALL edge labels: the label count was gated on _edges.size() == emitted_size, which only holds for untruncated chains. Labels align with the chain's leaf-first element order, so truncation now emits the first emitted_size labels and loses only the root-side ones. - ObjectLivenessEvent::leak_tag is default-initialized to 0 so any construction path that forgets to set it serializes a defined untagged value (flush_table() overwrites it from the entry, which track() zeroes at insert). Moves the JFR round-trip and arguments parsing unit tests into this layer (they test exactly this code), rewrites the round-trip test to construct events directly instead of through the tracker, and adds byte-level boundary tests: oversize-chain truncation with label preservation, the size-prefix invariant, and the default leak tag.
Uncommitted plan documents, rotted .cpp:NNN line references, and a nonexistent j9WallClock.cpp path replaced with symbol references that stay valid as the code moves.
- ReferenceChainEvent carries one vector of ReferenceChainHop (klass id + retention-edge label) instead of two parallel vectors - Compress the sub-option floor/ceiling rationale and the provisional default constant comments to one concise statement each - Drop design-doc and Jira references from code comments; revert the unrelated LineNumberTable comment rewrite
The event/argument comments named collector classes, methods and files that do not exist at this layer of the stack; describe the contracts without those forward references instead.
- releaseLeakTag: bounds + double-release guards with new counters - drop dead marker-branch and terminal tag=0 GetObjectsWithTags loop - defer resolved-chain invalidation out of STW callbacks (drained in runPass) - nextTag: FRONTIER_TAG_NAMESPACE_CEILING guard; canary EMA in ns - PriorityExpandSet zero-init + full-table termination; ctor canary-candidate init - hop bounds in buildCanaryChainEvent; collapsed cacheChain signature - new gtest coverage (DoubleRelease, PriorityExpandSet, ClassTagAllocator)
…y observability - leak-tag pool: dedicated SpinLock, double-release + release-overflow guards (REFERENCE_CHAIN_LEAK_TAG_* counters), getLeakTagInfo under pool lock - tagLeakInstances: 3-phase restructure; track(): exclusive fill - cleanup_table: cached_klass_id gate, account_epoch, epoch_diff clamp - accumulateKlassCount: direct index via klassCountScratchSlot (MAX_DISTINCT_AGES) - rep-probe amortization (last_rep_probe_epoch); flush_table -> resolveKlassId - admitForTracking: LIVENESS_URGENT_BOOST_ADMITS/BACKED_OFF counters - secondsToOOM: zero-denominator guard; ringThirdsStats -> ringWindowStats - javaApi test-seed comment now names ringWindowStats - new gtest coverage (leak-tag pool, DipThenRecover, OddLengthRisingWindow)
os_linux: getContainerMemoryLimit/Usage now share g_container_mem_lock (limit writer on start thread vs usage reader on GC-callback threads) and remember the winning usage leaf so per-GC reads skip the /proc/self/cgroup re-walk. os_macos: getContainerMemoryUsage returns -1 with the contract spelled out (0 would read as zero usage and skew the secondsToOOM slope).
Port from jb/rc-3-refchain-tracker: foldKlassCountsLocked() now runs even when _klass_count_scratch is empty and, after folding the scratch, records a zero sample for every _klass_population entry not touched this epoch. Without it a klass whose every tracked instance died keeps its last positive count and consecutive_positive trend, staying a leak candidate until eviction. Adds the foldKlassCountsZeroSampleForTest() seam; the rc-3 KlassPopulationTest coverage passes unchanged against the reworked fold.
The stacked tracker implementation is the monolithic referenceChains.cpp; nothing includes these rc-3 split-TU fragments.
rc-3 extracted FrontierTable into referenceChainFrontier.h; the stacked implementation keeps it in referenceChains.h with the same public API (insert/lookup/markEdge/improveChain/reconstructChain, FrontierEntry fields), so the target only needs the include swapped.
0b0f8d8 to
1173f79
Compare
What does this PR do?:
Wires the reference-chain engine into the profiler lifecycle:
Profilerstarts/stopsReferenceChainTrackerandLivenessTrackerwith the recording, drains resolved chain events into JFR ondump(), and emits abandoned-search events.ObjectSampleralways informsLivenessTrackerof the recording's flags so they cannot go stale across recordings.javaApi.cppadds the reference-chain natives and test seams;JavaProfiler.javadeclares them.vmEntryGC-event hooks feed the tracker.Motivation:
Part 4 of the stacked series for PROF-15341; makes the tracker from the previous PR reachable from a live recording.
Additional Notes:
Stacked on #797.
How to test the change?:
buildDebugcompiles and links; end-to-end behavior is covered by the Java integration tests later in the stack.For Datadog employees: