claude-code - 💡(How to fix) Fix claude.exe processes accumulate 50+GB virtual memory in long-running sessions (remoteControlAtStartup=true) [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
anthropics/claude-code#50718Fetched 2026-04-20 12:14:59
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

When remoteControlAtStartup is enabled, claude.exe processes started in separate terminals do not exit when their terminal is closed, and accumulate very large amounts of virtual memory over hours. On 2026-04-15 my system triggered Windows Resource-Exhaustion-Detector (Event ID 2004) six times between 22:06 and 01:45 with three orphaned claude.exe processes:

PIDVirtual Memory
18900~56 GB
37364~24 GB
14204~5 GB

Total: ~86 GB virtual memory across 3 processes. System pagefile is 96 GB so the machine did not crash, but other apps were affected (Chrome and PowerToys MouseWithoutBordersHelper crashed during the same window).

A fresh claude.exe started today already grew to ~12 GB virtual memory within 2.5 hours of normal use, suggesting steady growth rather than a single spike.

Root Cause

When remoteControlAtStartup is enabled, claude.exe processes started in separate terminals do not exit when their terminal is closed, and accumulate very large amounts of virtual memory over hours. On 2026-04-15 my system triggered Windows Resource-Exhaustion-Detector (Event ID 2004) six times between 22:06 and 01:45 with three orphaned claude.exe processes:

PIDVirtual Memory
18900~56 GB
37364~24 GB
14204~5 GB

Total: ~86 GB virtual memory across 3 processes. System pagefile is 96 GB so the machine did not crash, but other apps were affected (Chrome and PowerToys MouseWithoutBordersHelper crashed during the same window).

A fresh claude.exe started today already grew to ~12 GB virtual memory within 2.5 hours of normal use, suggesting steady growth rather than a single spike.

Fix Action

Workaround

Set "remoteControlAtStartup": false and use /exit to terminate sessions.

RAW_BUFFERClick to expand / collapse

Environment

  • Claude Code version: 2.1.114
  • OS: Windows 11 Pro (10.0.26200)
  • Node: bundled
  • Setting: "remoteControlAtStartup": true in ~/.claude.json

Summary

When remoteControlAtStartup is enabled, claude.exe processes started in separate terminals do not exit when their terminal is closed, and accumulate very large amounts of virtual memory over hours. On 2026-04-15 my system triggered Windows Resource-Exhaustion-Detector (Event ID 2004) six times between 22:06 and 01:45 with three orphaned claude.exe processes:

PIDVirtual Memory
18900~56 GB
37364~24 GB
14204~5 GB

Total: ~86 GB virtual memory across 3 processes. System pagefile is 96 GB so the machine did not crash, but other apps were affected (Chrome and PowerToys MouseWithoutBordersHelper crashed during the same window).

A fresh claude.exe started today already grew to ~12 GB virtual memory within 2.5 hours of normal use, suggesting steady growth rather than a single spike.

Reproduction

  1. Set "remoteControlAtStartup": true in ~/.claude.json (default for some users via the Remote Control rollout dialog).
  2. Open several claude sessions in separate terminals over the course of a day. Close terminals normally (Alt+F4 / X) without /exit.
  3. After several hours, check Get-Process claude | select VirtualMemorySize64 — orphan processes remain and VM grows continuously.

Expected

Either:

  • claude.exe exits when its parent terminal closes, OR
  • The Remote Control daemon stays as a single shared process, not one per ever-spawned terminal session, OR
  • VM stays bounded.

Actual

Each session leaves a long-lived claude.exe whose virtual memory keeps growing.

Workaround

Set "remoteControlAtStartup": false and use /exit to terminate sessions.

Notes

  • No outbound listening port observed on the host, so Remote Control appears to use an outbound websocket / relay.
  • --dangerously-skip-permissions is in use but should be unrelated.
  • Windows Event Viewer source: Microsoft-Windows-Resource-Exhaustion-Detector, Event ID 2004, naming claude.exe PIDs as the top virtual memory consumers.

extent analysis

TL;DR

Disabling "remoteControlAtStartup" or ensuring proper exit of claude.exe sessions can mitigate the virtual memory growth issue.

Guidance

  • Verify that disabling "remoteControlAtStartup" in ~/.claude.json resolves the issue, as suggested in the provided workaround.
  • When using Remote Control, ensure that claude.exe sessions are properly terminated with /exit to prevent orphaned processes.
  • Monitor virtual memory usage of claude.exe processes over time to detect any potential growth patterns.
  • Consider reviewing system resource utilization and adjusting settings to prevent similar resource exhaustion events in the future.

Example

No specific code snippet is applicable in this case, as the issue appears to be related to configuration and process management.

Notes

The provided workaround suggests that disabling Remote Control at startup or properly exiting sessions can mitigate the issue. However, the root cause of the virtual memory growth remains unclear, and further investigation may be necessary to fully resolve the problem.

Recommendation

Apply the workaround by setting "remoteControlAtStartup": false and using /exit to terminate sessions, as this has been shown to mitigate the virtual memory growth issue.

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

claude-code - 💡(How to fix) Fix claude.exe processes accumulate 50+GB virtual memory in long-running sessions (remoteControlAtStartup=true) [1 participants]