Repository navigation
Conversation
antiguru
force-pushed
the
moritz/heap-introspection-spike
branch
from
October 29, 2026 19:36
cc2d385 to
b7c4b0b
Compare
Throwaway. Requires a locally patched timely, see Cargo.toml. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
antiguru
force-pushed
the
moritz/heap-introspection-spike
branch
from
October 29, 2026 20:02
b7c4b0b to
755c20e
Compare
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.
Spike, not for merge. Exposes the allocation tracker's sampled live heap as two compute introspection sources,
mz_heap_live_per_operatorandmz_heap_stacks, attributed to the timely operator that made each sampled allocation. The sources join withmz_dataflow_operators, so aSUBSCRIBEkeeps a per-operator heap breakdown up to date.misc/spike/heap-flame.htmlrenders one as a live flame graph over the WebSocket SQL API.Attribution needs to know the scheduled operator at allocation time. Timely's logger cannot provide it, because its events are buffered and arrive after the allocation. The spike therefore patches timely with TimelyDataflow/timely-dataflow#831, a thread-local holding the scheduled operator's identifier. The tracker reads it only for sampled allocations.
TraceManager::maintenanceandallow_compactionclaim the arrangement's operator, so merge work driven from compute maintenance is charged to the arrangement.On a local 4-worker replica with lgalloc off and a 64 KiB sample interval, the tracker accounted for 2280 of 2300 MiB anonymous RSS. Operators received 92% of it, 4% was unattributed (persist blob reads on tokio threads), and the rest was the logging dataflow, mostly the in-process symbolizer. Per arrangement, sampled heap matched
mz_arrangement_sizescapacity within about 1%. With lgalloc on, the sources miss lgalloc's file mappings. In a 60 s CPU profile the scheduling hook and the snapshot code did not appear, and the tracker's sampling path took about 4.6% of samples at the 64 KiB interval.Open points before a design: release images strip DWARF, so in-process symbolization yields function names only, and stacks should be symbolized off the replica by build ID. The tag also needs a runtime component if a process hosts more than one timely runtime.
🤖 Generated with Claude Code