PoC: feat(profiling): add heap-live profiling for memory leak detection#3623
PoC: feat(profiling): add heap-live profiling for memory leak detection#3623realFlowControl wants to merge 3 commits intomasterfrom
Conversation
|
Benchmarks [ profiler ]Benchmark execution time: 2026-02-12 08:02:42 Comparing candidate commit 91f9d71 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 9 unstable metrics. |
bc087f2 to
817465a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3623 +/- ##
==========================================
+ Coverage 62.11% 62.20% +0.08%
==========================================
Files 141 141
Lines 13387 13387
Branches 1753 1753
==========================================
+ Hits 8315 8327 +12
+ Misses 4273 4263 -10
+ Partials 799 797 -2 see 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Benchmarks [ tracer ]Benchmark execution time: 2026-02-06 08:47:53 Comparing candidate commit 49b5835 in PR branch Found 1 performance improvements and 4 performance regressions! Performance is the same for 186 metrics, 3 unstable metrics. scenario:ComposerTelemetryBench/benchTelemetryParsing
scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching2
scenario:SamplingRuleMatchingBench/benchRegexMatching3
scenario:SamplingRuleMatchingBench/benchRegexMatching4
|
4aaffbf to
540cc19
Compare
0ecb066 to
79ff80d
Compare
Track allocations that survive across profile exports using heap-live-samples and heap-live-size sample types. Samples are emitted in batches at export time. Enabled via DD_PROFILING_HEAP_LIVE_ENABLED when allocation profiling is active. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Use functional style (map + match) in collect_batched_heap_live_samples - Only create ProfileIndex when heap-live tracking is enabled - Replace 32 repetitive I/O profiling lines with a loop - Use filter_map in sample type filter method - Add early bail-out in free_allocation when heap-live is disabled Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace default SipHash with a simple bit-mixing hasher optimized for pointer addresses. Since pointers are already well-distributed, we use `ptr ^ (ptr >> 4)` instead of expensive cryptographic hashing. This reduces overhead in untrack_allocation() which is called on every free. Co-Authored-By: Claude Opus 4.5 <[email protected]>
d87cdf9 to
91f9d71
Compare
Warning
do not merge, this is PoC
Description
Track allocations that survive across profile exports using
heap-live-samplesandheap-live-sizesample types. Samples are emitted in batches at export time.Enable via
DD_PROFILING_HEAP_LIVE_ENABLEDordatadog.profiling.heap_live_enabled(default disabled), only works when allocation profiling is active.Reviewer checklist
PROF-13688