[BUG] FATAL ERROR: Reached heap limit
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude-Code was troubleshooting a persistent bug and crashed with the below error. This has happened multiple times working on this same bug it is troubleshooting.
What Should Happen?
Claude-code to continue successfully
Error Messages/Logs
<--- Last few GCs --->
[47607:0x25128000] 58702957 ms: Mark-Compact 1949.9 (1988.1) -> 1942.3 (2003.8) MB, pooled: 1 MB, 173.53 / 0.04 ms (average mu = 0.316, current mu = 0.202) allocation failure; scavenge might not succeed
[47607:0x25128000] 58703191 ms: Mark-Compact (reduce) 1952.2 (2004.3) -> 1949.8 (1980.3) MB, pooled: 0 MB, 102.65 / 0.01 ms (+ 56.3 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 225 ms) (average mu = 0.320, cu
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0xe1803a node::OOMErrorHandler(char const*, v8::OOMDetails const&) [claude]
2: 0x11ec9c0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [claude]
3: 0x11ecc97 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [claude]
4: 0x141a575 [claude]
5: 0x1433e09 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [claude]
6: 0x1385bc8 v8::internal::StackGuard::HandleInterrupts(v8::internal::StackGuard::InterruptLevel) [claude]
7: 0x1842cef v8::internal::Runtime_HandleNoHeapWritesInterrupts(int, unsigned long*, v8::internal::Isolate*) [claude]
8: 0x1da1476 [claude]
Steps to Reproduce
Have claude-code test a process and have a bug, use multiple sub-agents to assist in process.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
1.0.117
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
No response
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/952
- https://github.com/anthropics/claude-code/issues/1421
- https://github.com/anthropics/claude-code/issues/5388
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
same issue , running /init command on ubuntu .
I found one of the reason is subagents invoke another subagent inside it, which causes the issue and Aborts the claude code
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.