Commit 08d24d4
Improve memory debugging docs with simpler heap snapshot approach (#3072)
## Summary
- Document `NODE_OPTIONS="--heapsnapshot-signal=SIGUSR2"` as the
recommended approach for capturing heap snapshots — a built-in Node flag
that requires no code changes, versus the existing custom
`process.on('SIGUSR2', ...)` handler approach
- Add a step-by-step production container workflow for capturing
snapshots from running deployments and copying them locally for analysis
- Mention running the renderer as a separate workload for easier memory
isolation during diagnosis
Based on community discussion about practical memory debugging
approaches in production.
## Changed files
- `docs/pro/js-memory-leaks.md` — Split heap snapshot section into
recommended (built-in flag) and detailed (custom handler) options; add
production container workflow
- `docs/oss/building-features/node-renderer/debugging.md` — Rewrite
memory leaks section with simpler quick-start approach and isolation tip
- `docs/pro/troubleshooting.md` — Add heap snapshot flag as first
investigation step
## Test plan
- [x] All links pass lychee checks (verified by pre-commit and pre-push
hooks)
- [x] Prettier formatting passes
- [ ] Review rendered markdown for clarity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: documentation-only updates that don’t change runtime
behavior, but could mislead users if commands/flags are incorrect.
>
> **Overview**
> **Improves memory-leak debugging guidance for the Node Renderer** by
recommending Node’s built-in
`NODE_OPTIONS="--heapsnapshot-signal=SIGUSR2"` workflow to capture
`.heapsnapshot` files without adding custom code.
>
> Adds clearer instructions for capturing and comparing snapshots in
Chrome DevTools, documents a production container workflow (append to
existing `NODE_OPTIONS`, find worker PIDs, signal multiple workers, copy
snapshots out), and updates troubleshooting to point to this approach
first; also notes that running the renderer as a separate workload can
simplify isolation during diagnosis.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1f1c725. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3336bab commit 08d24d4
3 files changed
Lines changed: 72 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
68 | 94 | | |
69 | 95 | | |
70 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
140 | 156 | | |
141 | 157 | | |
142 | | - | |
143 | 158 | | |
144 | 159 | | |
145 | 160 | | |
146 | | - | |
| 161 | + | |
147 | 162 | | |
148 | 163 | | |
149 | 164 | | |
150 | 165 | | |
151 | 166 | | |
152 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
153 | 183 | | |
154 | 184 | | |
155 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments