#5446·openwork

Renderer memory leak: V8 heap grows to 4 GB cap over a ~7 h session, then Electron OOM crash (SIGTRAP, `electron.v8-oom`)

Author: monoosoCreated Sep 29, 2026Updated Sep 29, 2026

Environment

Title Value
App OpenWork 0.18.54 (Arch AUR openwork 0.18.54-1, latest at time of writing)
Runtime Electron 43.2.0 / Chromium 150.0.7871.129
OS Arch Linux x86_64, Wayland
Workspace local, preset starter, single chat session (ses_f16c5e249ffeya2J8964GSIu0t, 7 prompts)
Model used GLM-5.3 via zai-coding-plan (streaming, with reasoning content)

Summary

The renderer process's V8 heap grew to its ~4 GB cap over ~6 h 45 m of a single session (7 prompts in the evening, then several hours idle with the screen locked). At that point full GCs could no longer reclaim memory and Electron's V8 OOM handler deliberately crashed the renderer (SIGTRAP via int3).

Chromium restarted the renderer ~15 s later and the session was recovered from the sidecar server. No user-visible data loss.

The retained heap was dominated by OpenWork UI-internal data, not conversation content: the single most frequent string in the 4 GB heap was local|ws_1b39359f92d1|__new-task__, present 662,617 times.

Timeline (2026-09-28/29, BST)

  • 19:09 — renderer started (app launch)
  • Evening — 7 prompt_async runs in one chat session, heavy streaming
  • 01:30–01:56 — screen locked, app idle, background polling only
  • 01:55:22 — renderer dies with SIGTRAP
  • 01:55:37 — Chromium respawns the renderer, app-recovery.v1.json written, session reloaded
  • Afterwards — replacement renderer stable at ~260 MB RSS for 9.5 h idle, so the growth is usage-driven rather than a constant idle leak

Evidence

From coredumpctl analysis of the dead renderer (PID 620311):

  1. Deliberate crash, not corruption. SIGTRAP / SI_KERNEL with RIP Chromium's IMMEDIATE_CRASH() sequence (int3 / ud2 / int3 filler).

  2. Crash site is Electron's V8 OOM handler. The crashing frame chain builds the Sentry attribute strings electron.v8-oom.heap.total, electron.v8-oom.heap.limit, electron.v8-oom.heap.total_available before terminating the process.

  3. Heap was exhausted and unreclaimable. The last V8 GC traces were on the crashing thread's stack, timestamped to the crash second (24,342 s ≈ 6 h 45 m after renderer start):

[620311:0x3934004c8000] 24342404 ms: Scavenge 3974.6 (4112.0) -> 3949.9 (4112.0) MB, pooled: 0.0 MB, 5.18 / 0.00 ms (average mu = 0.433, current mu  
 = 0.000) allocation failure;                                                                                                                            
    [620311:0x3934004c8000] 24343823 ms: Mark-Compact 3950.0 (4112.0) -> 3945.7 (4112.0) MB, pooled: 0.0 MB, 1407.94 / 0.02 ms (average mu = 0.666,      
 current mu = 0.771) allocation failure; GC in old space requested                                                                                                                                                                                                                                             

Heap pinned at ~3.95 GB of the 4.11 GB limit; a 1.4 s Mark-Compact reclaimed ~4 MB.

  1. What the 4 GB consisted of (string-frequency profile of the heap):

    Count String
    662,617 local|ws_1b39359f92d1|__new-task__
    5,310 reasoning_content
    4,800 reasoning.encrypted_content
    1,316 data: {"type":"server.heartbeat"} (SSE heartbeat frames)
    903 http://127.0.0.1:33909/workspace/ws_1b39359f92d1/events?since=1
    thousands each duplicated provider-catalog entries (@ai-sdk/openai-compatible, https://api.llmgateway.io/v1, …)

    For scale: the entire session/workspace storage on disk (opencode sidecar data) is 4.9 MB — the heap was ~800× the size of the actual conversation.

  2. Not external pressure. 30 GB RAM mostly free, no OOM kill, no suspend, swap untouched. Purely in-process V8 heap growth.

For Sentry correlation: crash-reporter GUID fb64b98b-77b6-4bae-8678-389621d81a5d, crash at 2026-09-29 00:55:22 UTC.

Hypotheses (unverified — shipped binary is stripped, no debug symbols)

  • The __new-task__ count works out to ~27 objects/s if averaged over the renderer's whole lifetime, suggesting something in the UI creates and retains an object per event/tick tagged with the "new task" group key and never releases it (either steady per-tick accumulation or bursty growth during streaming).
  • The 903 retained …/events?since=1 URLs and ~1.3 k retained SSE heartbeat frames suggest event-stream state accumulating per reconnect. In the openwork-server log, the /workspace/<id>/events and /session-groups/events requests complete in 0–1 ms and recur every ~3 s. In other words, the streams appear to close immediately and the client reconnects each time with since=1.

Steps to reproduce (approximate)

  1. Launch OpenWork 0.18.54 with a local workspace.
  2. Run several prompts in one chat session (mine used GLM-5.3 with reasoning).
  3. Leave the app open for several hours (idle/locked screen is fine).
  4. Watch the renderer's RSS climb (e.g. ps -o rss -p <renderer-pid>); eventually the renderer dies with SIGTRAP and reloads.

Low-impact reproduction may only need step 2 plus monitoring during/after streaming.

Expected vs actual

  • Expected: renderer heap roughly proportional to the visible conversation.
  • Actual: ~4 GB retained heap → V8 OOM → renderer crash and reload.

Impact

  • Crash notification and UI reload; session state is held by the sidecar server, so no data loss observed.
  • Long-running sessions are effectively unusable. The leak recurs for as long as the app stays open with prior activity, until the heap cap is hit.

Happy to provide the full coredumpctl output or the complete heap string profile; the coredump is retained on my machine.