openclaw - 💡(How to fix) Fix ACP sessions leave orphaned node processes after completion/crash (Windows) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60647Fetched 2026-04-08 02:48:46
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Error Message

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Fix Action

Workaround

Periodic cleanup script that kills processes matching claude-agent-acp, claude-agent-sdk, and related npx launchers.

Code Example

wmic process where "name='node.exe'" get ProcessId,CommandLine

---

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
RAW_BUFFERClick to expand / collapse

Problem

Each ACP session spawns 3 node processes (npx launcher, claude-agent-acp adapter, claude-agent-sdk CLI). When sessions complete or crash, these processes are NOT cleaned up. Over time this leaks massive amounts of RAM.

Reproduction

  1. Run multiple ACP sessions via sessions_spawn(runtime: "acp")
  2. After they complete, check running processes:
    wmic process where "name='node.exe'" get ProcessId,CommandLine
  3. Zombie processes remain from completed/crashed sessions.

Impact

We found 200+ orphaned node processes consuming ~2.5 GB RAM on a machine with 8 GB total. New ACP sessions crashed with:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Environment

  • OS: Windows 10 (10.0.19045)
  • OpenClaw: v2026.4.2 (npm global install)
  • Node.js: v22.16.0
  • Plugin: acpx with [email protected]

Workaround

Periodic cleanup script that kills processes matching claude-agent-acp, claude-agent-sdk, and related npx launchers.

Expected Behavior

The acpx plugin should terminate all child processes when an ACP session ends (whether success or failure). This likely requires killing the entire process tree, not just the top-level spawned process.

extent analysis

TL;DR

Implement a reliable process cleanup mechanism to terminate all child processes spawned by ACP sessions, preventing memory leaks.

Guidance

  • Identify and track all spawned child processes (including claude-agent-acp, claude-agent-sdk, and npx launchers) to ensure proper cleanup.
  • Develop a script or integrate a solution that kills the entire process tree when an ACP session ends, rather than just the top-level process.
  • Consider implementing a periodic cleanup task as a temporary workaround to mitigate the issue until a permanent fix is in place.
  • Verify the effectiveness of the cleanup mechanism by monitoring process counts and memory usage after ACP sessions complete or crash.

Example

No explicit code example is provided due to the lack of specific implementation details in the issue.

Notes

The exact implementation of the process cleanup mechanism may depend on the specific requirements and constraints of the ACP sessions and the environment in which they run.

Recommendation

Apply a workaround by implementing a periodic cleanup script that targets the identified processes (claude-agent-acp, claude-agent-sdk, and related npx launchers) until a permanent fix can be integrated into the acpx plugin to properly manage and terminate child processes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING