Commit 50dfa4f
fix(docs): bound docs build memory to stop Vercel OOM (exit 137) (#3221)
The @objectstack/docs build was killed on Vercel with exit 137 (SIGKILL /
container OOM). The site statically prerenders 400+ MDX pages, and two things
let the build's resident set exceed the 8 GB build container:
1. Next spawns one static-generation worker per CPU. On Vercel's high-core
build container that fan-out multiplied peak RSS. Cap it with
`experimental.cpus: 2`.
2. Without an explicit heap ceiling, V8 sizes its max heap from the memory it
detects and defers GC — in a container that reports host memory rather than
the cgroup limit, RSS grows past the container limit before GC runs, and the
kernel SIGKILLs the process (137). Pin the heap with
`NODE_OPTIONS=--max-old-space-size=4096` so GC keeps RSS bounded.
Verified locally: the full docs build completes cleanly with peak RSS ~4.9 GB
(down from an unbounded ~5.3 GB+), well under the 8 GB container.
Claude-Session: https://claude.ai/code/session_01KjroXa16g7LyNAP3sThibY
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2f3c641 commit 50dfa4f
2 files changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments