Server dies with V8 heap OOM (SIGABRT) while session warming is active

Đang mở
#65,371 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/plugins platform/linux type/bug version/v2

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

  1. "warming": true in opencode.json
  2. Let a few sessions be warmed (or just leave them idle)
  3. 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).

Ngôn ngữ chính
TypeScript
Star
227k
Fork
30.7k
Merge trung bình
3 giờ 57 phút
Pull request đã merge (30 ngày)
484

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.