Server dies with V8 heap OOM (SIGABRT) while session warming is active
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- performance
调研方向
Start by reading the gist timeline to confirm the heap ratchet lines up with each warming cycle, then open packages/core/src/plugin/warming.ts and trace what a warming pass retains after it returns — the reporter points at the full session context being rebuilt and not persisted. Reproduce with "warming": true on a build matching 2.3.2 and take heap snapshots across two or three cycles (e.g. via the server's inspect port) to see whether the growth is in warming itself or in the reply path it triggers. Done looks like a demonstrated retention point plus either a fix or a size/throttle change to the warming interval, with the gist's RSS pattern no longer reproducing.
由索引模型根据 Issue 内容生成。
描述
Description
OpenCode server v2.3.2 with "warming": true in opencode.json died with a JavaScript heap OOM four times today (2026-11-21, at 17:13 / 17:38 / 18:01 / 18:33), each time while a reply was generating (busySessionCount 1 / 1 / 2 / 2). With no user activity the server heap floors at ~2 GB and peaks at 4.3–4.7 GB; smaps at the peak is ~97% anonymous private dirty (Rss 4,060,184 kB, Pss_Anon 3,949,200 kB, Pss_File 18,009 kB), so it is V8 heap, not file cache.
Log correlation: warming session and scheduled session warming (interval="240000 millis") entries run every ~4 minutes across 10+ sessions, all day, every day. The session that was mid-reply at the 18:01 crash had warming generations at 17:49:15 / 17:53:15 / 17:57:15 / 18:01:15 and died 36 seconds after the last one. The same warming load ran from 11-11 to 11-20 with zero crashes; the crashes started the day after I upgraded the CLI to 2.3.2 and the desktop app that bundles the server. I cannot prove that upgrade is the trigger (no old builds left to A/B), but the growth tracks the warming cadence exactly: after each restart the heap starts at 0.15–0.84 GB and ratchets up with every warming cycle until it dies 24–32 minutes later.
My guess is packages/core/src/plugin/warming.ts: each cycle re-sends the full session context, the reply is not persisted, and the heap only grows. The crashing session had 26 messages, so it is not a "session got too big" spiral.
After I removed "warming" from the config (~18:36), the same server stopped ratcheting: RSS sawtooths 0.4–2 GB on real requests but returns to a ~0.85 GB floor. Only ~10 minutes of post-change data so far; monitoring continues.
Ruled out: kernel OOM killer, manual restart, config reload, and a second opencode serve --service on the same machine (that one stayed healthy for over a day; I did not check whether warming was active in it).
Evidence (unlisted gist): journal excerpts of the four restart diagnostics, the 1 Hz RSS curve with per-epoch floors/peaks, smaps_rollup at the peak, and the warming log timeline — https://gist.github.com/MorningStar0709/c8e53eb59286765144e202f2f6c6d9b8
Plugins: session warming (core, enabled via config). The same server process also loads billion-context, @openchamber/opencode-search-providers and two local plugins; I list them for completeness — the growth pattern (ratchet between warming cycles, sawtooth otherwise) points at warming.
OpenCode version: 2.3.2 — the server binary is the one bundled by the OpenChamber 2.7.3 desktop app; not reproduced with a standalone CLI-launched server.
Steps to reproduce
"warming": truein opencode.json- Let a few sessions be warmed (or just leave them idle)
- Within about an hour the server dies:
FATAL ERROR: ... Allocation failed - JavaScript heap out of memory
OS: Linux
Terminal: none (server process, no TTY)
Questions: is this a known issue? Could warming skip or throttle sessions with large contexts, or free the per-cycle context afterwards? A size-aware interval would also help (core has a global warming.interval; openchamber/openchamber#5955 asks for a per-session one).
- 主要语言
- TypeScript
- 星标
- 227k
- 派生
- 30.7k
- 平均合并
- 3 小时 57 分钟
- 30 天内合并 PR
- 484
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
[Site] Active section detection should respect scroll-margin-top可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area/web reproduced type/bug
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#65384 · 1 条评论 ·
维护者通常 1 天内回复
-
area/cli type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#65379 · 1 条评论 ·
维护者通常 1 天内回复
-
Shell tool: no upper bound on the timeout a model can ask for, so one call can hold a turn for hours未关闭area/core platform/linux type/feature version/v2
难度 2/5 1-3 小时 新手友好度 75/100
anomalyco/opencode#65254 · 1 条评论 ·
维护者通常 1 天内回复
-
inference/go type/feature
难度 1/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#65148 · 1 条评论 ·
维护者通常 1 天内回复
-
area/providers type/feature version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#64845 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offers可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭catalog provider provider-compatibility
难度 2/5 1-3 小时 新手友好度 62/100
lidge-jun/opencodex#9037 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 62/100
slavakurilyak/awesome-ai-agents#1005 ·
-
kind/bug triage/unresolved
难度 2/5 1-3 小时 新手友好度 60/100
维护者通常 1 天内回复
-
effort:S P3 refactor
难度 2/5 1-3 小时 新手友好度 72/100
nightscout/nocturne#3735 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
wpilibsuite/systemcore-blocks-interface#641 ·
维护者通常 2 天内回复