Files
orca/src/main/worker-threads
Neil 99e75ebdde fix(orcad): stop the managed server crash-looping under a ulimit -v address-space limit (#38263)
* fix(orcad): fit orcad inside a `ulimit -v` address-space limit

On hosts that cap virtual memory (ulimit -v 8 GiB on an HPC node), the
managed orcad crash-looped with "Failed to reserve virtual memory for
CodeRange" whenever it started a worker thread.

Two reservations used up the limit:
- undici's WASM HTTP parser, loaded by the first fetch, reserves a
  trap-handler guard region (4-9 GiB). The pinned-Node orcad launch now
  passes --disable-wasm-trap-handler --wasm-max-mem-pages=1024.
- each Worker isolate reserves V8's default CodeRange (512 MB on x64,
  ~600 MB of address space per worker). Main-process workers now go
  through spawnWorkerThread(), which caps the code range at 64 MB, and
  a lint rule keeps new sites on it.

Fixes #37538. Thanks to lin-tianyu for the report and logs.

* fix(orcad): keep the runtime selector one command; enforce spawnWorkerThread with ast-grep

Refs #37538

* test(orcad): run the address-space regression on Node

Refs #37538

* docs(orcad): note the WASM memory cap at the pinned-Node flags

Refs #37538
2026-11-04 17:00:52 -08:00
..