Skip to content

fix(LinuxShellExecutor): fix RLIMIT_AS/NOFILE defaults causing Node.js V8 OOM#370

Merged
lioensky merged 2 commits into
lioensky:mainfrom
XiaoHeiGe527:pr/fix-linuxshell-rlimit-oom
Jun 21, 2026
Merged

fix(LinuxShellExecutor): fix RLIMIT_AS/NOFILE defaults causing Node.js V8 OOM#370
lioensky merged 2 commits into
lioensky:mainfrom
XiaoHeiGe527:pr/fix-linuxshell-rlimit-oom

Conversation

@XiaoHeiGe527

Copy link
Copy Markdown
Contributor

Problem

When running shell commands via LinuxShellExecutor, the default resource limits cause Node.js child processes to crash with:

Fatal process out of memory: SegmentedTable::InitializeTable (subspace allocation)
Trace/breakpoint trap (core dumped)

Root cause: RLIMIT_AS=536870912 (512MB virtual address space) is set as the default. Node.js V8 with pointer compression requires ~4GB of virtual address space just to initialize.

Additionally, RLIMIT_NOFILE=64 (64 file descriptors) is too low for Node.js (system default ~1024).

Diagnosis

Confirmed with:

# OLD 512MB: Node.js crashes silently
ulimit -v 524288; node -e "console.log(42)"  # no output, killed

# With fix (0 = no limit): works
ulimit -t 30 -f 20480 -u 10; node -e "console.log(42)"  # 42

This caused false perception that plugins (LightMemo, PaperReader, RAGDiaryPlugin, UrlFetch) were dead. They work normally when spawned by VCP directly.

Changes

  1. RLIMIT_AS default: 536870912 (512MB) → 0 (no restriction)
  2. RLIMIT_NOFILE default: 640 (inherit system default ~1024)
  3. -v and -n ulimit flags: now conditional — only emitted when limit > 0
  4. plugin-manifest.json: clarify ; is blocked, guide AI to use && instead

Backward Compatibility

Users with explicit RLIMIT_AS/RLIMIT_NOFILE values in config.env are unaffected.

🤖 Generated with Claude Code

sunfuwei and others added 2 commits June 21, 2026 05:48
…s V8 OOM

- Change RLIMIT_AS default from 512MB to 0 (unlimited).
  512MB triggers V8 SegmentedTable OOM on Node.js startup because
  V8 pointer-compressed heap requires ~4GB virtual address space.
- Change RLIMIT_NOFILE default from 64 to 0 (inherit system default).
  64 file descriptors is insufficient for Node.js (system default ~1024).
- Make -v/-n ulimit flags conditional: only emit when limit > 0,
  allowing 0 to mean "inherit / no restriction".
- Update plugin-manifest description to guide AI toward && instead of ;

Root cause confirmed: probe scripts run under LinuxShellExecutor with the
512MB ulimit caused all subprocess Node.js loads to OOM, falsely marking
plugins like LightMemo/PaperReader/UrlFetch as dead. With default=0 these
plugins work correctly in normal VCP operation.
@lioensky lioensky merged commit b999d20 into lioensky:main Jun 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants