Files
Brennan Benson 594a12b539 fix(native-chat): run chat readers in their own process; record main's allocation sites before memory runs out (#43535)
* fix(native-chat): run chat readers in their own utility process; record main's allocation sites before the V8 cage fills

Electron main and its worker threads share one ~3.25 GB V8 pointer cage, so a chat reader's heap
could push main into a fatal OOM. The journal SQL reader threads now run inside one Electron
utility process ("Orca chat reader"), falling back to in-process threads if it cannot start.
Hosted readers post v8-serialized bytes that the host forwards without decoding.

V8's near-heap-limit hooks never fire when the cage fills first, and a heap snapshot needs the
heap's size again, so main runs V8's sampling heap profiler from 1 GB committed heap and records
its top allocation sites as a durable breadcrumb and crash annotations from 2.5 GB.

* fix(utility-worker-host): a failed in-process fallback fails only its worker; sample main's heap after the worker reads

* fix(utility-worker-host): retry the host after a slow or failed start with a backoff; only a reader that can't load there stays in-process for the session
2026-11-17 15:38:11 -08:00
..