RUM-18154: Buffer trigger profiles through PendingTriggerProfiles and dispatch via writeTriggerProfile - #3808
Draft
ambushwork wants to merge 1 commit into
Draft
Conversation
|
ambushwork
force-pushed
the
yl/memory/wire-heap-dump-to-writer
branch
2 times, most recently
from
September 1, 2026 15:51
a9c5224 to
bcbfce9
Compare
… dispatch via writeTriggerProfile
ambushwork
force-pushed
the
yl/memory/wire-heap-dump-to-writer
branch
from
September 1, 2026 16:32
bcbfce9 to
0cfdbab
Compare
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?
Wires OOM and memory-anomaly heap histograms into the profiling upload path. Adds a new
PendingTriggerProfilesbuffer that pairs a trigger-captured Perfetto trace with its gating RUM error event (RumOomErrorEvent/RumAnomalyErrorEvent), and dispatches matched pairs to the newProfilingDataWriter.writeTriggerProfile(...). Unmatched captures/signals expire after 5s (or on feature stop) and are discarded so no trace file leaks.Also relaxes the
ProfilingManagerTriggerRegistrarstaleness cutoff so it only applies to ANR: OOM/Anomaly captures are always forwarded even when the callback is delayed, and the registrar now keeps the histogram file — the feature owns its lifetime.Motivation
RUM already emits its own OOM error events; the profiling feature needs to correlate those with the captured heap histogram and upload them together as a trigger profile. The capture and the RUM error arrive asynchronously, so they must be buffered and matched by trigger type.
Additional Notes
MAX_CALLBACK_DELAY_MS) now applies only to ANR, whose thread dump is live and time-sensitive; OOM/Anomaly trace files are captured at the actual trigger time, so delayed callbacks must still be forwarded.PendingTriggerProfilesTestcovers matching (both arrival orders), trigger-type mismatch, expiry (device vs server clock drift), override, and cleanup.Review checklist (to be filled by reviewers)