Repository navigation
feat(diagnostics): name what grew in renderer OOM crash reports - #9984
Conversation
Renderer OOMs are the dominant crash class (heap pinned at the ~3.5GB V8 ceiling in crash-channel reports) but renderer_memory breadcrumbs carry only heap totals, so reports say "it grew" without saying what. Add a one-shot renderer_memory_highwater breadcrumb at 60%/80% of the heap limit carrying leak-diagnosis counts: DOM node census, terminal element count, and per-subsystem counts from a new contributor registry. The store registers the first contributor, reporting its 20 largest top-level collections. Counts only, capped per contributor; zero work on the 60s sample path while below threshold.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds bounded renderer memory profiling, including contributor registration, state collection summaries, finite-value filtering, error handling, and budget limits. Renderer diagnostics now emit one-time memory high-water breadcrumbs with surface and profile data, while the crash breadcrumb store retains threshold profiles separately from recent breadcrumbs. Pop-out and store integrations identify the renderer surface and contribute state metrics. Tests cover these behaviors, a lifecycle assertion becomes order-independent, and skill release metadata and snapshot registry JSON are updated. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…-heap-highwater # Conflicts: # resources/skills/release-mapping.json
…lyai#9984) * feat(diagnostics): name what grew in renderer OOM crash reports Renderer OOMs are the dominant crash class (heap pinned at the ~3.5GB V8 ceiling in crash-channel reports) but renderer_memory breadcrumbs carry only heap totals, so reports say "it grew" without saying what. Add a one-shot renderer_memory_highwater breadcrumb at 60%/80% of the heap limit carrying leak-diagnosis counts: DOM node census, terminal element count, and per-subsystem counts from a new contributor registry. The store registers the first contributor, reporting its 20 largest top-level collections. Counts only, capped per contributor; zero work on the 60s sample path while below threshold. * fix(diagnostics): retain renderer heap profiles * test(agent-status): remove subagent row order race * fix(diagnostics): bound aggregate heap profile work * fix(diagnostics): bound heap profile contributor calls * fix(types): avoid overloaded stat return inference * fix(diagnostics): fully bound heap profile registry * chore(skills): refresh release snapshot manifest * fix(diagnostics): retain browser counts in heap profiles
What & why
Renderer OOM is now Orca's dominant crash class: the July crash-channel sweep shows ~38 of ~40 recent macOS
crashed(exit 5) reports — and 34 Windowsoomreports — with the V8 heap pinned at the ~3.5 GB ceiling (usedHeapMB=2661…3586 / heapLimitMB=3586, trajectories like 25→2823→3586 over hours). Butrenderer_memorybreadcrumbs record only heap totals, so every report says that the heap grew and nothing about what grew.This PR makes the next OOM self-diagnosing:
renderer_memory_highwaterbreadcrumb, emitted once per threshold per session when the heap crosses 60% / 80% of the limit, carrying leak-diagnosis counts: DOM node census, terminal element count, heap totals, and per-subsystem counts.renderer-memory-profile.ts): subsystems push counters in, socrash-diagnosticsstays a leaf module. Counts only — never raw buffers — with a 32-count per-contributor cap and a 64-count aggregate cap.Fix evidence
This is instrumentation, so the evidence is behavior proofs (unit-tested) + bounded cost (adversarially verified):
60emission, no re-emission on repeat ticks, then one80emission; a fresh session at 85% emits both levels in one tick. ANaNheap reading emits nothing (and cannot disarm the one-shot).ReturnType<typeof stat>resolving to an optional overload; both now use Node’s concreteStatstype.ELI5
Today's crash reports are like a bathroom scale that only says "you gained weight" — every OOM report shows the memory number maxed out, with no clue which part of the app ate it. This change adds a tripwire: the first time memory passes 60% (and again at 80%), the app writes down a quick inventory — "how many worktrees, how many terminal elements, how big is each data table" — into the crash report. When the crash lands in the crash channel, the report itself names the suspect instead of needing a week of archaeology.
Trade-offs
Adversarial review & perf
NaNheap reading would have spuriously emitted both levels and permanently disarmed the one-shot — guard now uses a finiteness type predicate), plus the defensive 32-key cap and jump-to-80% coverage it suggested.Follow-ups (not this PR)