File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ---
3+
4+ chore(spec): 把 DTS 构建的堆上限从 12288 降到 8192(#4845 )
5+
6+ 发布面零变化 —— 改的是 ` packages/spec ` 的 ` build ` 脚本里 DTS 那一趟的
7+ ` --max-old-space-size ` ,不影响任何产物内容,故为空 changeset。
8+
9+ ` --max-old-space-size ` 是** 允许 V8 涨到多少的上限,不是预留** 。设成 12288 时,
10+ V8 在逼近 12 GB 之前都不积极 GC;而 ` Test Core ` 跑在 16 GB 的 ` ubuntu-latest `
11+ 上,叠加堆外内存与其它进程后总量越过物理内存,** 内核 OOM-killer 先于 V8 的
12+ OOM 处理把进程杀掉,于是没有任何 Node 侧错误输出** —— 日志里只看到
13+ ` DTS Build start ` 紧接着 ` ELIFECYCLE Command failed. ` 。
14+
15+ 也就是说这个数字不是防 OOM,而是 OOM 的成因之一。
16+
17+ 实测(15 GB / 可用 13 GB 的机器,与 CI runner 同量级): DTS 构建在 8192 上限下
18+ ** 成功完成,峰值 RSS 6.29 GB** 。8 GB 上限相对真实需求留约 27% 余量,同时给
19+ runner 剩下约 8 GB 供堆外与系统使用。
20+
21+ 一个上午内四次命中,横跨内容毫不相干的 PR(纯删除 / wire 形状迁移 / 纯文案
22+ patch),第四次发生在** 合并队列** 里并把 PR 踢了出来 —— 说明命中取决于是否真的
23+ 跑这一趟 DTS(turbo 缓存失效时),与改动内容无关。
Original file line number Diff line number Diff line change 182182 " spec-changes.json"
183183 ],
184184 "scripts" : {
185- "build" : " pnpm gen:schema && pnpm gen:openapi && tsup && if [ -z \" $OS_SKIP_DTS\" ]; then NODE_OPTIONS=\" --max-old-space-size=12288 \" BUILD_DTS=true tsup; fi" ,
185+ "build" : " pnpm gen:schema && pnpm gen:openapi && tsup && if [ -z \" $OS_SKIP_DTS\" ]; then NODE_OPTIONS=\" --max-old-space-size=8192 \" BUILD_DTS=true tsup; fi" ,
186186 "dev" : " tsc --watch" ,
187187 "clean" : " rm -rf dist" ,
188188 "gen:schema" : " OS_EAGER_SCHEMAS=1 tsx scripts/build-schemas.ts" ,
Original file line number Diff line number Diff line change @@ -21,7 +21,18 @@ const entries = [
2121 'src/shared/index.ts'
2222] ;
2323
24- // Generate DTS separately to avoid memory issues
24+ // Generate DTS separately to avoid memory issues.
25+ //
26+ // [#4845] The DTS pass runs under an explicit `--max-old-space-size` (see the
27+ // `build` script in package.json). That number is a CEILING V8 is allowed to
28+ // grow to, NOT a reservation — set it above what the machine can actually give
29+ // and V8 simply stops collecting aggressively, grows past physical memory, and
30+ // the kernel OOM-killer takes the process with NO diagnostic output at all
31+ // (`DTS Build start` followed straight by `ELIFECYCLE`). It was 12288 on a
32+ // 16 GB `ubuntu-latest` runner, which is that failure, not a guard against it:
33+ // four CI hits in one morning across PRs that shared no content — including one
34+ // pure-prose patch — and the fourth ejected a PR from the merge queue.
35+ // Keep this comfortably under the runner's physical memory.
2536const isDts = process . env . BUILD_DTS === 'true' ;
2637
2738export default defineConfig ( {
You can’t perform that action at this time.
0 commit comments