Repository navigation
[Bug] Desktop host aborts with "JavaScript heap out of memory" (~2.9 GB) and the 4 GB heap cap cannot be raised from outside #11830
Replies: 1 comment
SummaryThe DSH host process ( Under systemd This is a leak, not a transient spike: the last GC before a crash reclaims ~0 MB, i.e. the heap is full of live, reachable objects that GC cannot collect. Environment
Observed behavior
EvidenceLast GC before a crash (lane 1,
Heap-OOM crash count per lane (
Growth timeline (15-min polling, VmRSS), all after a fresh restart:
Ruled out:
Secondary observation (possibly related)One lane held the same 2 agents pinned for 5+ continuous hours (never released after their tasks finished) while its memory climbed ~1.9 GB. Agent/session teardown may not be releasing state. This is a separate defect but likely in the same area as the heap accumulation. ImpactOn a 15 GB box, 3 lanes consumed ~9.3 GB RSS over ~10 h and pushed the host into swap; each lane OOM-crashes roughly once per day if left running. This makes long-lived headless DSH deployments unreliable. WorkaroundWe restart each idle lane when RSS crosses a threshold (e.g. >2.2 GB and Version notes
Happy to provide full logs, a minimal repro, or run a specific branch to help bisect — let me know what would be most useful. |
Uh oh!
There was an error while loading. Please reload this page.
Environment
require('v8').getHeapStatistics().heap_size_limit= 4192 MBSymptom
Three host crashes in 24 h, all identical:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
GC: Mark-Compact (reduce) 2859.4 (2942.8) -> 2859.1 (2878.3) MB, last resort; GC in old space requested
Crash lands inside
node::fs::AfterStat(i.e. any callback can be the drop point — no single culprit).After the abort the app auto-restarts and re-opens the same large sessions, so it can crash again within minutes.
Why we cannot work around it
Tried all three ways to raise the limit; none works:
[ERROR:electron/shell/app/node_main.cc:154] Node.js environment variables are disabled because this process is invoked by other apps.— still 4192 MB.So only the spawn site inside the app could set it.
Ask
Evidence
Happy to attach the full crash logs if useful; the excerpt above is verbatim from
~/Library/Logs/DeepSeek Harness/crash-*.log.
中文摘要
本机 24GB 内存,24 小时内宿主三次因 JS 堆上限(4192MB)耗尽而 abort,崩在普通 fs 回调里;
外部三种方式(NODE_OPTIONS / 直接传参 / --js-flags)都无法提高上限,只有应用内部 spawn 处能改。
诉求:①上限可配置;②到顶前优雅降级而不是整进程 abort;③自动重启时限制同时恢复的大会话数量。
All reactions