feat(heap): net/gross/peak heap analysis across call tree and timeline - #868
Merged
Merged
Conversation
Split heap into three distinct metrics through the parser, call-tree aggregation, table columns and timeline tooltip. - parser: track signed running live-heap to seed heapPeak (max-composed up the tree), keep heapAllocated as net (alloc − free), add heapGross for churn; governor heap = max(reported snapshot peak, computed heapPeak) - aggregation: attribute self heap from direct leaf children only; roll peak up by max so root equals the transaction peak - call-tree/tabulator: replace single Heap column with Net/Net-self/Peak/Alloc/Alloc-self byte columns and per-table footer calcs (peak always 'max', net-total call-stack deduped) - format governor heap with formatInteger (thousand-separated) and show a net-heap tooltip row, omitted when net is 0
- extract LogEvent.seedHeapLeaf so HeapAllocateLine/BulkHeapAllocateLine share the net/gross/peak seeding - add createSelfSumHeapFooters for the aggregated + time-order tables' identical heap footers - delegate timeline formatNumber to the shared Util.formatInteger instead of a duplicate toLocaleString
- add Heap analysis changelog entry (certinia#32) and a Governor Limit Tracking README section - describe net/gross/peak and the Memory view in the Call Tree docs - note the governor strip builds usage per log event, not just at cumulative snapshots
lcottercertinia
approved these changes
Jul 23, 2026
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.
📝 PR Overview
Heap was a single number that hid what actually happened, since Apex frees memory as well as allocating it. This splits heap into three metrics — net retained, gross allocated, and peak live — through the parser, call tree, tooltips and the timeline limits strip, so you can tell a real leak from harmless allocate-then-free churn and compare a path against the heap governor.
🛠️ Changes made
heapPeak(max-composed up the tree), keepheapAllocatedas net (alloc − free), addheapGrossfor churn; governor heap = max(reported snapshot peak, computed peak).max, net-total call-stack deduped); Memory view shows all three; Governor Avg/Peak use peak.LogEvent.seedHeapLeafandcreateSelfSumHeapFooters; delegate timelineformatNumberto the sharedUtil.formatInteger.🧩 Type of change (check all applicable)
📷 Screenshots / gifs / video [optional]
Visible surfaces: the new Call Tree / Memory heap columns and the method tooltip heap row.
🔗 Related Issues
closes #32
✅ Tests added?
📚 Docs updated?
Anything else we need to know? [optional]