Recurring crashes: JavaScript Heap Out of Memory while 'thinking'
Open 💬 66 comments Opened May 29, 2025 by rayozzie
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
Claude Code crashes on a recurring basis with "JavaScript heap out of memory" in the middle of thought. It is so common that I had never reported it, thinking that I wouldn't spam you. But in looking at github issues, I don't see it. Regrets if this is already well known.
It manifests itself several ways, and it happens both on my mac and on an ubuntu instance where I use claude. Here are several stack traces that I captured over the past 5 days.
• Implementing... (2340s • * 820 tokens • esc to interrupt)
>
? for shortcuts
Bypassing Permissions
<--- Last few GCs --->
[1452221:0xf1964ae20000] 47007665 ms: Scavenge 2027.3 (2079.3) -> 2021.7 (2080.3) MB, pooled: 0 MB, 4.65 / 0.01 ms
(average mu = 0.749, current mu = 0.771) allocation failure;
[1452221:0xf1964ae20000] 47007682 ms: Scavenge 2029.4 (2080.3) -> 2021.7 (2096.3) MB, pooled: 0 MB, 4.70 / 0.00 ms
(average mu = 0.749, current mu = 0.771) allocation failure;
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
--- Native stack trace
1: 0xde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8::Utils::Report00MFailure(v8::internal::Isolate*, char const*, v8::00MDetails const&) [nodel
3: 0x1169f1c v8:: internal:: V8:: FatalProcessOut0fMemory(v8::internal::Isolate*, char const*, v8::00MDetails const&) [node]
4: 0x138e7cc [node]
5: 0x13a6740 v8: :internal: :Heap: :CollectGarbage (v8::internal:: AllocationSpace, v8::internal:: GarbageCollectionReas on, v8:: GCCallbackFlags) [nodel
6: 0x137d068 v8:: internal::HeapAllocator: :AllocateRawWithLightRetrySlowPath(int, v8: :internal:: AllocationType, v8:
: internal:: AllocationOrigin, v8: :internal:: AllocationAlignment) [node]
7: 0x137dea0 v8: :internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal:: AllocationType, v8 ::internal:: AllocationOrigin, v8: :internal:: AllocationAlignment) [node]
8: 0x13587c0 v8:: internal:: Factory:: AllocateRaw(int, v8::internal:: AllocationType, v8::internal:: AllocationAlignme nt) [node]
9: 0x1346bb8 v8: :internal:: FactoryBase<v8:: internal:: Factory>::AllocateRawWithImmortalMap(int, v8::internal::Alloc ationType, v8: :internal:: Tagged<v8: :internal:: Map>, v8:: internal:: AllocationAlignment) [nodel
10: 0x13480cc v8:: internal:: FactoryBase<v8:: internal:: Factory>::NewRawOneByteString(int, v8::internal:: AllocationTy pe) [nodel
11: 0x1363638 v8: :internal:: Factory::NewStringFromUtf8(v8::base: :Vector<char const>, v8: :internal:: AllocationType) [node]
12: 0x1185e4C V8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [node]
13: 0xf407a8 [node]
14: 0x1bee0f4 [node]
Aborted (core
Musing... (340s • T 3.0k tokens • esc to interrupt)
? for shortcuts
Bypassing Permissions
<--- Last few GCs --->
[1161188:0xf166ff4c0000] 42824177 ms: Mark-Compact 2042.9 (2086.8) -> 2042.1 (2086.8) MB, pooled: 0 MB, 1231.41 / 0
.00 ms (average mu = 0.418, current mu = 0.004) allocation failure; scavenge might not succeed
[1161188:0xf166ff4c0000] 42825532 ms: Mark-Compact 2044.1 (2086.8) -> 2043.9 (2094.5) MB, pooled: 0 MB, 1353.90 / 0
.00 ms
(average mu = 0.262, current mu = 0.000) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Native stack trace
1: Oxde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [nodel
2: 0x1169d6c v8::Utils: :Report00MFailure(v8: :internal::Isolate*, char const*, v8::00MDetails const&) [node]
3: 0x1169f1c v8:: internal::V8:: FatalProcessOut0fMemory(v8: :internal::Isolate*, char const*, v8::00MDetails const&)
[node ]
4: 0x138e7cc [node]
5: 0x13a6740 v8::internal:: Heap:: CollectGarbage (v8: :internal:: AllocationSpace, v8: :internal:: GarbageCollectionReas on, v8:: GCCallbackFlags) [nodel
6: 0x137d068 v8:: internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal:: AllocationType, v8:
: internal:: AllocationOrigin, v8: :internal::AllocationAlignment) [node]
7: 0x137dea0 v8: :internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8: :internal:: AllocationType, v8 ::internal:: AllocationOrigin, v8:: internal:: AllocationAlignment) [node]
8: 0x1358c0 v8: :internal:: Factory: NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::Allocati onType, v8:: internal:: AllocationOrigin) [nodel
9: 0x177296c v8: :internal:: Runtime_AllocateInYoungGeneration(int, unsigned long*, v8: :internal:: Isolate*) [nodel
10: 0x1c819d4 [node]
Aborted (core dumped)
Striving... (193s • 1 1.7k tokens • esc to interrupt)
? for shortcuts
Bypassing Permissions
Context left until auto-compact: 12%
<--- Last few GCs --->
[1295239:0xebab1d8900001 21565009 ms: Scavenge 1972.0 (2053.9) -> 1962.6 (2053.9) MB, pooled: 0 MB, 5.59 / 0.01 ms
(average mu = 0.373, current mu = 0.363) allocation failure;
[1295239:0xebab1d890000] 21566232 ms: Mark-Compact 1983.7 (2067.2) -> 1936.6 (2028.1) MB, pooled: 26 MB, 1171.94 /
0.01 ms
(average mu = 0.335, current mu = 0.296) task; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
--—-- Native stack trace ---
1: 0xde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [nodel
2: 0x1169d6c v8:: Utils: :Report00MFailure(v8::internal::Isolate*, char const*, v8::00MDetails const&) [node]
3: 0x1169f1c v8:: internal:: V8:: FatalProcessOut0fMemory(v8::internal::Isolate*, char const*, v8::00MDetails const&)
[nodel
4: 0x138e7cc [node]
5: 0x138e7fc
[node]
6: 0x13a61e0 [node]
7: 0x13a8dcc
[node ]
8: 0x1b8d9a4 [node]
Aborted (core dumped)
Debugging... (197s • 1 1.2k tokens • esc to interrupt)
› L
? for shortcuts
Bypassing Permissions
<--- Last few GCs --->
1898043:0xee87c08c0000 45950489 mS: Mark-Compact 2038.3 (2086.6) - 2036.3 (2086.6) MB, pooled: 0 MB, 1377.71 / 0.
00 ms (average mu = 0.155, current mu = 0.006) allocation failure; scavenge might not succeed
[898043:0xee87c08c0000] 45951883 ms: Mark-Compact 2038.4 (2086.6) -> 2036.5 (2086.6) MB, pooled: 0 MB, 1392.06 / 0.
00 ms
(average mu = 0.082, current mu = 0.001) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Native stack trace
1: 0xde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8:: Utils:: Report00MFailure(v8: :internal::Isolate*, char const*,
v8: :00MDetails const&) [node]
3: 0x1169f1c v8:: internal:: V8:: FatalProcessOut0fMemory(v8:: internal:: Isolate*,
char const*, v8::00MDetails const&)
[node]
4: 0x138e7cc
[node ]
5: 0x138e7fc
[node]
6: 0x13a61e0 [node]
7: 0x13a8dcc [node]
8: 0x1b8d9a4 [node]
Aborted (core dumped)
Achieving... (888s • T 11.9k tokens • esc to interrupt)
? for shortcuts
Bypassing Permissions
<--- Last few GCs --->
[988433:0xe431e34f0000] 31846577 ms: Scavenge (interleaved) 2038.7 (2084.3) -> 2038.6 (2095.1) MB, pooled: 0 MB, 9.
32 / 0.00 ms
(average mu = 0.698, current mu = 0.170) allocation failure;
[988433:0xe431e34f0000] 31848429 ms: Mark-Compact (reduce) 2045.4 (2095.1) -> 2045.2 (2087.8) MB, pooled: 0 MB, 169
6.94 / 0.00 ms
(+ 43.8 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking
1754 ms) (average mu = 0.
‹--- JS stacktrace -->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
--- Native stack trace --
1: 0xde5bfc node: :00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8::Utils::Report00MFailure(v8::internal:: Isolate*, char const*, v8::00MDetails const&) [node]
3: 0x1169f1c v8: :internal::V8:: FatalProcessOut0fMemory (v8: :internal::Isolate*, char const*, v8::00MDetails const&) [node]
4: 0x138e7cc [node]
5: 0x13a6740 v8: :internal:: Heap:: CollectGarbage (v8::internal:: AllocationSpace, v8: :internal:: GarbageCollectionReas on, v8:: GCCallbackFlags) [nodel
6: 0x137d068 v8:: internal: :HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8:
: internal:: AllocationOrigin, v8::internal:: AllocationAlignment) [node]
7: 0x137dea0 v8: :internal: :HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8 ::internal:: AllocationOrigin, v8: :internal::AllocationAlignment) [node]
8: 0x1358c0 v8: :internal:: Factory: NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::Allocati onType, v8:: internal:: AllocationOrigin) [nodel
9: 0x177296c v8:: internal:: Runtime_AllocateInYoungGeneration(int, unsigned long*, v8: :internal:: Isolate*) [node]
10: 0x1c819d4 [node]
Aborted (core dumped)
<--- Last few GCs --->
1781133:0xfbe3346200001 21208030 ms: Scavenge (interleaved) 2030.8 (2080.8) - 2030.1 (2082.1) MB, pooled: 0 MB, 10
•97 / 0.00 ms (average
mu = 0.810, current mu = 0.160) allocation failure;
[781133:0xfbe334620000] 21208138 ms: Scavenge (interleaved) 2031.9 (2082.1) -> 2030.8 (2104.1) MB, pooled: 0 MB, 10
6.15 / 0.00 ms (average mu = 0.810, current mu = 0.160) allocation failure;
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
-_—_- Native stack trace ---
1: Oxde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8::Utils::Report00MFailure(v8: :internal:: Isolate*, char const*,
v8:: 00MDetails const&) [nodel
3: 0x1169f1c v8:: internal:: V8:: FatalProcessOut0fMemory(v8::internal::Isolate*, char const*, v8::00MDetails const&)
[node ]
4: 0x138e7cc [node]
5: 0x13a6740 v8: :internal::Heap: :CollectGarbage(v8: :internal::AllocationSpace, v8::internal:: GarbageCollectionReas on, v8:: GCCallbackFlags) [nodel
6: 0x137d068 v8: :internal: :HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8:
:internal::AllocationOrigin, v8: :internal:: AllocationAlignment) [nodel
7: 0x137dea0 v8:: internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal:: AllocationType, v8 ::internal:: AllocationOrigin, v8: :internal:: AllocationAlignment) [node]
8: 0x1358c0 v8: :internal:: Factory::NewFillerObject(int, v8::internal:: AllocationAlignment, v8::internal: :Allocati onType, v8: :internal:: AllocationOrigin) [node]
9: 0x177296c v8: :internal: :Runtime_AllocateInYoungGeneration(int, unsigned long*, v8: :internal:: Isolate*) [node]
10: 0x1c819d4 [nodel
Aborted (core dumped)
<—-- Last few GCs --->
[456736:0xfe18152c0000] 51008632 ms: Mark-Compact 2042.0 (2086.1) -> 2040.0 (2086.1) MB, pooled: 0 MB, 1394.59 / 0.
00 ms
(average mu = 0.065, current mu = 0.001) allocation failure; scavenge might not
succeed
[456736:0xfe18152c0000] 51010045 ms: Mark-Compact 2042.1 (2086.4) -> 2040.2 (2086.4) MB, pooled: 0 MB, 1411.24 / 0.
00 ms
(average mu = 0.034, current mu = 0.001) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
---- Native stack trace -
1: Oxde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c V8::Utils::Report00MFailure(v8::internal::Isolate*, char const*, v8::00MDetails const&) [node]
3: 0x1169f1c v8:: internal:: V8:: FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::00MDetails const&) [node]
4: 0x138e7cc [node]
5: 0x138e7fc [node]
6: 0x13a61e0
[node ]
7: 0x13a8dcc [node]
8: 0x1b8d9a4 [node]
Aborted (core dumped)
Polishing... (474s • T 3.4k tokens • esc to interrupt)
? for shortcuts
Bypassing Permissions
<—-- Last few GCs --->
[592347:0xe940cae90000] 30814645 ms: Mark-Compact (reduce) 2042.7 (2085.2) -> 2042.3 (2085.2) MB, pooled: 0 MB, 556 .91 / 0.00 ms (+ 772.9 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1412 ms) (average mu = 0.[592347:0xe940cae90000] 30816182 ms: Mark-Compact 2043.3 (2085.2) -> 2043.1 (2089.0) MB, р
ooled: 0 MB, 1536.71 / 0.00 ms (average mu = 0.508, current mu = 0.000) allocation failure; scavenge might not suc
ceed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
_---- Native stack trace
1: 0xde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8:: Utils: :Report00MFailure (v8::internal:: Isolate*, char const*, v8::00MDetails const&) [node]
3: 0x1169f1c v8:: internal::V8: :FatalProcessOutOfMemory(v8:: internal::Isolate*, char const*, v8::00MDetails const&) [node ]
4: 0x138e7cc [node]
5: 0x13a6740 v8: :internal: :Heap: :CollectGarbage(v8: :internal:: AllocationSpace, v8: :internal:: GarbageCollectionReas on, v8: :GCCallbackFlags) [node]
6: 0x137d068 v8: :internal::HeapAllocator::A1locateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8: :internal:: AllocationOrigin, v8:: internal:: AllocationAlignment) [node]
7: 0x137dea0 v8: :internal: :HeapAllocator: :AllocateRawWithRetry0rFailSlowPath(int, v8::internal:: AllocationType, v8 ::internal: :AllocationOrigin, v8: :internal: :AllocationAlignment) [node]
8: 0x1358fc0 v8:: internal:: Factory::NewFiller0bject(int, v8: :internal: :AllocationAlignment, v8: :internal:: Allocati onType, v8: :internal:: AllocationOrigin) [node]
9: 0x177296c v8:: internal: :Runtime_AllocateInYoungGeneration(int, unsigned long*, v8: :internal:: Isolate*) [node]
10: 0x1c819d4 [node]
Aborted (core dumped)
Analyzing. (58s • * 325 tokens • esc to interrupt)
> I
? for shortcuts
Bypassing Permissions
Context left until auto-compact: 6%
<--- Last few GCs --->
[302432:0xe8f2c1eb0000] 24439521 ms: Scavenge (reduce) (interleaved) 1990.4 (2032.1) -> 1989.6 (2032.1) MB, pooled:
0 MB, 5.12 / 0.00 ms (average mu = 0.379, current mu = 0.368) allocation failure;
[302432:0xe8f2c1eb0000] 24439614 ms: Mark-Compact (reduce) 1990.4 (2032.1) -> 1935.3 (2017.8) MB, pooled: 0 MB, 21.
64 / 0.01 ms (+ 1248.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking
1447 ms) (average mu = 0.
<——— JS stacktrace ———>
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
-—_—— Native stack trace
1: Oxde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8::Utils::Report00MFailure(v8::internal::Isolate*, char const*,
v8: :00MDetails const&) [node]
3: 0x1169f1c v8:: internal::V8:: FatalProcessOut0fMemory(v8::internal::Isolate*, char const*, v8::00MDetails const&)
[node ]
4: 0x138e7cc
[node ]
5: 0x138e7fc
[node ]
6: 0x13a61e0 [node]
7: 0x13a8dcc [node]
8: 0x1b8d9a4 [node]
Aborted (core dumped)
Catching... (1240s • * 12.7k tokens • esc to interrupt)
? for shortcuts
Bypassing Permissions
Context left until auto-compact: 4%
<--- Last few GCs --->
[73443:0xfb20a8880000] 15332031 ms: Scavenge (reduce) (interleaved) 1989.6 (2032.4) -> 1989.4 (2032.9) MB, pooled: 0 MB, 5.68 / 0.00 ms
(average mu = 0.364, current mu = 0.372) allocation failure;
[73443:0xfb20a8880000] 15332093 ms: Mark-Compact (reduce) 1989.9 (2032.9) -> 1937.1 (2017.7) MB, pooled: 0 MB, 22.92 / 0.01 ms (+ 1331
•5 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1574 ms) (average mu = 0.3
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace
1: Oxde5bfc node::00MErrorHandler(char const*, v8::00MDetails const&) [node]
2: 0x1169d6c v8::Utils::Report00MFailure(v8: :internal::Isolate*, char const*,
v8:: 00MDetails const&) [node]
3: 0x1169f1c v8: :internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::00MDetails const&) [node]
4: 0x138e7cc [node]
5: 0x138e7fc
[node]
6: 0x13a61e0 [node]
7: 0x13a8dcc [node]
8: 0x1b8d9a4 [node]
Aborted (core dumped)
Environment Info
- Platform: macos
- Terminal: Apple_Terminal
- Version: 1.0.5
- Feedback ID: 44e12588-9f33-4ad7-bc4d-e653872aa698
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:882:11)\n at execSync (node:child_process:954:15)\n at eG (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:644:3921)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:572:6540\n at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:532:16886)\n at aR1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:572:5789)\n at DG (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:572:5406)\n at TU2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1976:21058)","timestamp":"2025-05-29T22:40:06.662Z"},{"error":"Error: ENOENT: no such file or directory, scandir '/Users/rozzie/.claude/ide'\n at Module.readdirSync (node:fs:1581:26)\n at Object.readdirSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:1562)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1348:16549\n at Array.flatMap (<anonymous>)\n at Ev0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1348:16519)\n at xs (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:3280)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2391:11385\n at p7 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:21374)\n at cZ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:40861)\n at $W (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:34915)","timestamp":"2025-05-29T22:40:06.692Z"},{"error":"Error: ENOENT: no such file or directory, scandir '/Users/rozzie/.claude/ide'\n at Module.readdirSync (node:fs:1581:26)\n at Object.readdirSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:1562)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1348:16549\n at Array.flatMap (<anonymous>)\n at Ev0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1348:16519)\n at eB6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:1224)\n at Hv0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:3005)\n at Ov0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:6648)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2459:2113\n at p7 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:21374)","timestamp":"2025-05-29T22:40:06.693Z"},{"error":"Error: ENOENT: no such file or directory, scandir '/Users/rozzie/.claude/ide'\n at Module.readdirSync (node:fs:1581:26)\n at Object.readdirSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:1562)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1348:16549\n at Array.flatMap (<anonymous>)\n at Ev0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1348:16519)\n at xs (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:3280)\n at Hv0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:3072)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-05-29T22:40:06.699Z"},{"error":"Error: Command failed: /opt/homebrew/Cellar/ripgrep/14.1.1/bin/rg --files --hidden /Users/rozzie/tmp\nrg: /Users/rozzie/tmp/x2/pca10056/blank: Permission denied (os error 13)\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at ChildProcess.exithandler (node:child_process:414:12)\n at ChildProcess.emit (node:events:507:28)\n at ChildProcess.emit (node:domain:489:12)\n at maybeClose (node:internal/child_process:1101:16)\n at Socket.<anonymous> (node:internal/child_process:457:11)\n at Socket.emit (node:events:507:28)\n at Socket.emit (node:domain:489:12)\n at Pipe.<anonymous> (node:net:351:12)","timestamp":"2025-05-29T22:40:06.758Z"},{"error":"AxiosError: Request failed with status code 401\n
Note: Error logs were truncated.
66 Comments
You may wish to close this one, and just write it up in the doc that "if you see JavaScript Heap Out of Memory, get more memory". I just shifted my workload from a 24GB Macbook and a 16GB Ubuntu instance to a 128GB Ubuntu instance, and I haven't seen the heap out of memory for the full day.
Temporary solution:
Nah, they have a memory leak or an infinite loop - the corresponding
nodeprocess just fills up the whole heap (be it 8GB or more) and then crashes with the specified error OP postedTemporary fix:
I was also seeing this behavior in 1.0.10, and downgraded to 1.0.9 as @ulshv suggested -- does seem like a memory bug in 1.0.10
Same issue, keep crashing
<--- Last few GCs --->
[380286:0x556c2b398250] 1294935 ms: Mark-sweep 1877.5 (2084.6) -> 1861.9 (2084.6) MB, 82.8 / 0.0 ms (average mu = 0.288, current mu = 0.233) allocation failure; scavenge might not succeed
[380286:0x556c2b398250] 1295062 ms: Mark-sweep 1878.3 (2084.8) -> 1861.8 (2085.1) MB, 89.3 / 0.0 ms (average mu = 0.292, current mu = 0.296) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x556c27998954 node::Abort() [node]
2: 0x556c2782b666 node::OOMErrorHandler(char const*, bool) [node]
3: 0x556c27b9ffa4 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node]
4: 0x556c27ba0266 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node]
5: 0x556c27d65299 [node]
6: 0x556c27d6c64a [node]
7: 0x556c27d7c702 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*, v8::GCCallbackFlags) [node]
8: 0x556c27d7cf89 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0x556c27d58049 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0x556c27d59258 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
11: 0x556c27d3ce74 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
12: 0x556c27d36628 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
13: 0x556c27d3b429 v8::internal::MaybeHandle<v8::internal::SeqTwoByteString> v8::internal::FactoryBase<v8::internal::Factory>::NewRawStringWithMap<v8::internal::SeqTwoByteString>(int, v8::internal::Map, v8::internal::AllocationType) [node]
14: 0x556c2811f815 v8::internal::IncrementalStringBuilder::Extend() [node]
15: 0x556c27e86c48 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
16: 0x556c27e89e2e v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
17: 0x556c27e898d2 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
18: 0x556c27e8a7d2 v8::internal::JsonStringifier::Stringify(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
19: 0x556c27e8a8c5 v8::internal::JsonStringify(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
20: 0x556c27c24635 v8::internal::Builtin_JsonStringify(int, unsigned long, v8::internal::Isolate) [node]
21: 0x556c284eba79 [node]
Aborted (core dumped)
Same issue. Claude Code Status v1.0.11.
<--- Last few GCs --->
[51113:0x148008000] 1889744 ms: Scavenge 3874.1 (4138.7) -> 3870.7 (4138.7) MB, pooled: 0 MB, 2.54 / 0.00 ms (average mu = 0.828, current mu = 0.000) allocation failure;
[51113:0x148008000] 1889751 ms: Scavenge 3874.2 (4138.7) -> 3870.8 (4146.9) MB, pooled: 0 MB, 5.50 / 0.00 ms (average mu = 0.828, current mu = 0.000) allocation failure;
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x100d131e4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
2: 0x100f12fd8 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
3: 0x101120f30 v8::internal::Heap::stack() [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
4: 0x10111f2d0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
5: 0x1011138b8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
6: 0x1011140f0 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
7: 0x1010f7410 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
8: 0x101512ae4 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
9: 0x1019d5af4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
10: 0x107bf6750
11: 0x107dcbe94
12: 0x107929b70
13: 0x107f558e8
14: 0x107bf33ec
15: 0x107d68cf0
16: 0x107b31c68
17: 0x107aa4864
18: 0x107d6dffc
19: 0x107b2ff08
20: 0x10197d290 Builtins_AsyncFunctionAwaitResolveClosure [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
21: 0x101a484d8 Builtins_PromiseFulfillReactionJob [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
22: 0x10196d594 Builtins_RunMicrotasks [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
23: 0x10193eaf4 Builtins_JSRunMicrotasksEntry [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
24: 0x101078e6c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
25: 0x101079714 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
26: 0x10107984c v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate, v8::internal::MicrotaskQueue) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
27: 0x1010a6ac8 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
28: 0x1010a724c v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
29: 0x101942f98 Builtins_CallApiCallbackGeneric [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
30: 0x107794a14
31: 0x10193ec0c Builtins_JSEntryTrampoline [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
32: 0x10193e8f4 Builtins_JSEntry [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
33: 0x101078eac v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
34: 0x101078808 v8::internal::Execution::Call(v8::internal::Isolate, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
35: 0x100f29544 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
36: 0x100c1da80 node::InternalCallbackScope::Close() [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
37: 0x100c1dcc4 node::InternalMakeCallback(node::Environment, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>, node::async_context, v8::Local<v8::Value>) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
38: 0x100c32fd4 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
39: 0x100e25910 node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
40: 0x100e270a4 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
41: 0x100ea660c node::crypto::TLSWrap::ClearOut() [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
42: 0x100ea8574 node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
43: 0x100e2b56c node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
44: 0x100e2bcb4 node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s, long, uv_buf_t const) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
45: 0x1019276d8 uv__stream_io [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
46: 0x10192f920 uv__io_poll [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
47: 0x10191c674 uv_run [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
48: 0x100c1e508 node::SpinEventLoopInternal(node::Environment*) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
49: 0x100d5c154 node::NodeMainInstance::Run() [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
50: 0x100cd2364 node::Start(int, char**) [/Users/yoav/.nvm/versions/node/v22.14.0/bin/node]
51: 0x18c1cab98 start [/usr/lib/dyld]
zsh: abort /Users/yoav/.claude/local/claude --dangerously-skip-permissions
1.0.9 version crashes for me as well without any messages,
Anyone know where the logs are as I don't get any messaging just shuts down.
happened to me since today. v1.0.11
i just had this as well:
<--- Last few GCs --->
[169432:0x563e2f265cf0] 57652611 ms: Mark-sweep 4012.3 (4140.0) -> 4002.2 (4142.1) MB, 343.5 / 0.0 ms (average mu = 0.866, current mu = 0.094) allocation failure; scavenge might not succeed
[169432:0x563e2f265cf0] 57653240 ms: Mark-sweep 4020.6 (4142.1) -> 4010.6 (4144.1) MB, 599.6 / 0.0 ms (average mu = 0.692, current mu = 0.047) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x7fbe0d80333c node::Abort() [/lib/x86_64-linux-gnu/libnode.so.109]
2: 0x7fbe0d6f75db [/lib/x86_64-linux-gnu/libnode.so.109]
3: 0x7fbe0dbe9544 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/lib/x86_64-linux-gnu/libnode.so.109]
4: 0x7fbe0dbe9938 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [/lib/x86_64-linux-gnu/libnode.so.109]
5: 0x7fbe0ddd50e9 [/lib/x86_64-linux-gnu/libnode.so.109]
6: 0x7fbe0ddeac69 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/lib/x86_64-linux-gnu/libnode.so.109]
7: 0x7fbe0ddc5c5a v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
8: 0x7fbe0ddc6d78 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
9: 0x7fbe0dda6f01 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/lib/x86_64-linux-gnu/libnode.so.109]
10: 0x7fbe0e19e860 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [/lib/x86_64-linux-gnu/libnode.so.109]
11: 0x7fbe0daf91f9 [/lib/x86_64-linux-gnu/libnode.so.109]
Aborted (core dumped)
Update:
Just got a similar error again:
<--- Last few GCs --->
[497805:0x559ba67cf9c0] 2244524 ms: Mark-sweep 3804.1 (4129.2) -> 3787.8 (4129.2) MB, 103.8 / 0.0 ms (average mu = 0.226, current mu = 0.161) allocation failure; scavenge might not succeed
[497805:0x559ba67cf9c0] 2244651 ms: Mark-sweep 3804.5 (4129.5) -> 3787.9 (4129.5) MB, 99.5 / 0.0 ms (average mu = 0.222, current mu = 0.217) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x7f738df0133c node::Abort() [/lib/x86_64-linux-gnu/libnode.so.109]
2: 0x7f738ddf55db [/lib/x86_64-linux-gnu/libnode.so.109]
3: 0x7f738e2e7544 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [/lib/x86_64-linux-gnu/libnode.so.109]
4: 0x7f738e2e7938 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [/lib/x86_64-linux-gnu/libnode.so.109]
5: 0x7f738e4d30e9 [/lib/x86_64-linux-gnu/libnode.so.109]
6: 0x7f738e4d31cb [/lib/x86_64-linux-gnu/libnode.so.109]
7: 0x7f738e4e7d42 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*, v8::GCCallbackFlags) [/lib/x86_64-linux-gnu/libnode.so.109]
8: 0x7f738e4e88f6 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/lib/x86_64-linux-gnu/libnode.so.109]
9: 0x7f738e4c3c5a v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
10: 0x7f738e4c4d78 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/lib/x86_64-linux-gnu/libnode.so.109]
11: 0x7f738e4a4f01 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/lib/x86_64-linux-gnu/libnode.so.109]
12: 0x7f738e89c860 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [/lib/x86_64-linux-gnu/libnode.so.109]
13: 0x7f738e1f71f9 [/lib/x86_64-linux-gnu/libnode.so.109]
Aborted (core dumped)
1.0.11 (Claude Code)
I'm having the same problem on version 1.0.11. At the moment it's not usable.
Same issue for me when working on a larger project.
Version 1.0.11.
Claude's own analysis of the issue when I asked Claude Code to diagnose the crash
I'm having the same problem...
Same here, on v1.0.17
Same problem on a linux laptop with 96gb ram. Oom kicked in and killed it.
Didn't work for me. I open claude code and just leave it. after 5-10 minutes it takes up 130Gb+ of virtual memory
I'm experiencing this, too.
Log:
Is this a duplicate issue of https://github.com/anthropics/claude-code/issues/952 ?
Same here, can't downgrade to 1.09:
I really wish I hadn't paid for the pro plan just to get an unusable tool
happening repeatedly to me too today Current version: 1.0.51, plenty of memory available.
<details>
<summary>
Error
</summary>
</details>
We're actively working on improving memory usage. Expect this to feel better in the coming weeks.
I'm experiencing the identical crash pattern described in this issue. Here's my stack trace:
<--- Last few GCs --->
[48672:0x148008000] 857688 ms: Mark-Compact 3953.4 (4131.4) -> 3942.7 (4139.4) MB, pooled: 0 MB, 840.75 / 0.00 ms
(average mu = 0.406, current mu = 0.227) allocation failure; scavenge might not succeed
[48672:0x148008000] 859062 ms: Mark-Compact 3958.9 (4139.7) -> 3948.7 (4145.4) MB, pooled: 0 MB, 1360.08 / 0.00 ms
(average mu = 0.214, current mu = 0.010) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x102881cac node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/local/bin/node]
2: 0x102a57998 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&)
[/usr/local/bin/node]
3: 0x102c670c0 v8::internal::Heap::stack() [/usr/local/bin/node]
4: 0x102c65460 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace,
v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
5: 0x102c59a48 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType,
v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
6: 0x102c5a280 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType,
v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
7: 0x102c3d5a0 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment,
v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
8: 0x103059050 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate)
[/usr/local/bin/node]
9: 0x103519af4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
10: 0x1034de358 Builtins_CloneObjectIC_Slow [/usr/local/bin/node]
[...truncated similar to other reports...]
Context:
The crash happened while following PM2 development workflow, using Serena MCP for code analysis, similar to the
hook-related crashes described in issue #4732.
First time to see this issue
claude --version 1.0.67 (Claude Code)
I already upgraded my Javascript head to 8Gb , and it is not working. for me to is logical to still crash, increasing th memory just delay the crash and doesn't fix the issue of memory leaks or bad memory management. I am surprised that they took that long to fix the issue. I can see people suffering from it since version 1.0.5.
it is not related to subagent, issue appears vent you are just running Claude code.
Aborted()
<--- Last few GCs --->
[9365:0x138008000] 1126562 ms: Mark-Compact 8041.2 (8289.6) -> 7983.0 (8295.6) MB, pooled: 0 MB, 1540.75 / 0.00 ms (average mu = 0.172, current mu = 0.082) allocation failure; scavenge might not succeed
[9365:0x138008000] 1128220 ms: Mark-Compact 8047.0 (8295.6) -> 7988.8 (8301.3) MB, pooled: 0 MB, 1519.54 / 0.00 ms (average mu = 0.127, current mu = 0.083) allocation failure; scavenge might not succeed
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x104cceb58 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
2: 0x104e08af4 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
3: 0x104e08aac v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
4: 0x104fe56b0 v8::internal::Heap::stack() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
5: 0x104fe7df0 v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/24.5.0/bin/node]
6: 0x104fe7c90 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
7: 0x104ff561c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/opt/homebrew/Cellar/node/24.5.0/bin/node]
8: 0x104ff52c0 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack, void, void const*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
9: 0x10573d7b8 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/24.5.0/bin/node]
10: 0x104fe3c70 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
11: 0x104fdb878 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
12: 0x104fc322c v8::internal::Factory::AllocateRawWithAllocationSite(v8::internal::DirectHandle<v8::internal::Map>, v8::internal::AllocationType, v8::internal::DirectHandle<v8::internal::AllocationSite>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
13: 0x104fc6768 v8::internal::Factory::NewJSObjectFromMap(v8::internal::DirectHandle<v8::internal::Map>, v8::internal::AllocationType, v8::internal::DirectHandle<v8::internal::AllocationSite>, v8::internal::NewJSObjectType) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
14: 0x104f5ea28 v8::internal::(anonymous namespace)::GetStackFrames(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::FixedArray>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
15: 0x104f5e53c v8::internal::ErrorUtils::FormatStackTrace(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSObject>, v8::internal::DirectHandle<v8::internal::Object>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
16: 0x104f60f18 v8::internal::ErrorUtils::GetFormattedStack(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSObject>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
17: 0x104e4ba9c v8::internal::Accessors::ErrorStackGetter(v8::FunctionCallbackInfo<v8::Value> const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
18: 0x10576294c Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/24.5.0/bin/node]
19: 0x140a45ef0
20: 0x14059ddec
21: 0x105760bec Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/24.5.0/bin/node]
22: 0x1057616e0 Builtins_InterpreterEnterAtBytecode [/opt/homebrew/Cellar/node/24.5.0/bin/node]
23: 0x105761720 Builtins_InterpreterEnterAtNextBytecode [/opt/homebrew/Cellar/node/24.5.0/bin/node]
24: 0x1405f0650
25: 0x140a369fc
26: 0x1401b05c4
27: 0x140617b94
28: 0x140517bdc
29: 0x10579f648 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/24.5.0/bin/node]
30: 0x1058745f8 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/24.5.0/bin/node]
31: 0x10578ea50 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/24.5.0/bin/node]
32: 0x10575e7b0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/24.5.0/bin/node]
33: 0x104f3d90c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
34: 0x104f3dfb8 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
35: 0x104f3e0a8 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate, v8::internal::MicrotaskQueue) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
36: 0x104f62ca4 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
37: 0x104f62ac0 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
38: 0x10576294c Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/24.5.0/bin/node]
39: 0x14062a918
40: 0x10575e8cc Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/24.5.0/bin/node]
41: 0x10575e570 Builtins_JSEntry [/opt/homebrew/Cellar/node/24.5.0/bin/node]
42: 0x104f3d93c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
43: 0x104f3d32c v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
44: 0x104e19fe0 v8::Function::Call(v8::Isolate, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
45: 0x104c1c970 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
46: 0x104c1cbb0 node::InternalMakeCallback(node::Environment, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
47: 0x104c2ba5c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
48: 0x104d8e35c node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
49: 0x104d8f90c node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
50: 0x104dec9f8 node::crypto::TLSWrap::ClearOut() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
51: 0x104debe90 node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
52: 0x104dee648 node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
53: 0x104d920d0 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
54: 0x104d9258c node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s, long, uv_buf_t const) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
55: 0x109e73af0 uv__stream_io [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
56: 0x109e7aca8 uv__io_poll [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
57: 0x109e6ab58 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
58: 0x104c1d3ec node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
59: 0x104cfe0e8 node::NodeMainInstance::Run(node::ExitCode, node::Environment) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
60: 0x104cfde7c node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
61: 0x104ca4318 node::Start(int, char**) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
62: 0x19d7beb98 start [/usr/lib/dyld]
zsh: abort claude
@bcherny non of the open issues you mentioned have some one assigned to it. that means will not be fixed soon. that is really sad :( such a great tool keep crashing and wasting every one time since version 1,0,5 because no one is assigned to it. delaying its fix will simply mean the more features you launch fro Claude code the more the gravity of the situation will be.
I'm experiencing severe input lag in the interactive REPL mode, and I suspect it might be related to the memory issues described here. The performance degradation gets worse over time, which aligns with potential memory leaks.
My symptoms:
Environment:
Key observation: The input lag progressively worsens during long sessions, suggesting memory accumulation issues might be affecting the event loop performance. When the tool becomes very laggy, memory usage is often high.
Current workaround:
--printmode which doesn't exhibit these issues:echo "prompt" | claude --printCould the JavaScript heap issues be causing the event loop to slow down, resulting in the severe input lag many of us are experiencing? The correlation between session duration and performance degradation seems too strong to be coincidental.
Has anyone profiled the memory usage patterns during interactive sessions to see if there's a correlation with input responsiveness?
I am experiencing the same issue on MacOS Tahoe: Bypassing Permissions
Aborted()
<--- Last few GCs --->
[70625:0xb2d80c000] 349904 ms: Mark-Compact 8163.7 (8217.7) -> 8149.2 (8217.7) MB, pooled: 4 MB, 1384.58 / 0.00 ms (average mu = 0.144, current mu = 0.034) allocation failure; scavenge might not succeed
[70625:0xb2d80c000] 351851 ms: Mark-Compact 8165.2 (8217.7) -> 8150.6 (8219.2) MB, pooled: 2 MB, 1903.71 / 0.00 ms (average mu = 0.076, current mu = 0.022) allocation failure; scavenge might not succeed
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x100c7eb58 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
2: 0x100db8af4 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
3: 0x100db8aac v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
4: 0x100f956b0 v8::internal::Heap::stack() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
5: 0x100f97df0 v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/24.5.0/bin/node]
6: 0x100f97c90 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
7: 0x100fa561c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/opt/homebrew/Cellar/node/24.5.0/bin/node]
8: 0x100fa52c0 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack, void, void const*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
9: 0x1016ed7b8 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/24.5.0/bin/node]
10: 0x100f93c70 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
11: 0x100f8b878 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
12: 0x100f6135c v8::internal::FactoryBase<v8::internal::Factory>::NewStructInternal(v8::internal::ReadOnlyRoots, v8::internal::Tagged<v8::internal::Map>, int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
13: 0x100f81500 v8::internal::Factory::NewCallSiteInfo(v8::internal::DirectHandle<v8::internal::Union<v8::internal::Smi, v8::internal::HeapNumber, v8::internal::BigInt, v8::internal::String, v8::internal::Symbol, v8::internal::Boolean, v8::internal::Null, v8::internal::Undefined, v8::internal::JSReceiver>>, v8::internal::DirectHandle<v8::internal::Union<v8::internal::Smi, v8::internal::JSFunction>>, v8::internal::DirectHandle<v8::internal::HeapObject>, int, int, v8::internal::DirectHandle<v8::internal::FixedArray>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
14: 0x100f08088 v8::internal::(anonymous namespace)::CallSiteBuilder::AppendFrame(v8::internal::DirectHandle<v8::internal::Union<v8::internal::Smi, v8::internal::HeapNumber, v8::internal::BigInt, v8::internal::String, v8::internal::Symbol, v8::internal::Boolean, v8::internal::Null, v8::internal::Undefined, v8::internal::JSReceiver, v8::internal::Hole>>, v8::internal::DirectHandle<v8::internal::Union<v8::internal::Smi, v8::internal::JSFunction>>, v8::internal::DirectHandle<v8::internal::HeapObject>, int, int, v8::internal::DirectHandle<v8::internal::FixedArray>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
15: 0x100efac20 v8::internal::(anonymous namespace)::CaptureSimpleStackTrace(v8::internal::Isolate*, int, v8::internal::FrameSkipMode, v8::internal::Handle<v8::internal::Object>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
16: 0x100efa3b8 v8::internal::Isolate::CaptureAndSetErrorStack(v8::internal::DirectHandle<v8::internal::JSObject>, v8::internal::FrameSkipMode, v8::internal::Handle<v8::internal::Object>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
17: 0x100f10940 v8::internal::ErrorUtils::Construct(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSFunction>, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::FrameSkipMode, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::ErrorUtils::StackTraceCollection) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
18: 0x100e111d0 v8::internal::Builtin_ErrorConstructor(int, unsigned long, v8::internal::Isolate) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
19: 0x1017ade94 Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit [/opt/homebrew/Cellar/node/24.5.0/bin/node]
20: 0x1297d8508
21: 0x1297cda2c
22: 0x101710bec Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/24.5.0/bin/node]
23: 0x1017116e0 Builtins_InterpreterEnterAtBytecode [/opt/homebrew/Cellar/node/24.5.0/bin/node]
24: 0x12946a5f4
25: 0x12962b450
26: 0x1295be880
27: 0x1294b9764
28: 0x1294a2474
29: 0x12951e43c
30: 0x10174f648 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/24.5.0/bin/node]
31: 0x1018245f8 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/24.5.0/bin/node]
32: 0x10173ea50 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/24.5.0/bin/node]
33: 0x10170e7b0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/24.5.0/bin/node]
34: 0x100eed90c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
35: 0x100eedfb8 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
36: 0x100eee0a8 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate, v8::internal::MicrotaskQueue) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
37: 0x100f12ca4 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
38: 0x100f12ac0 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
39: 0x10171294c Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/24.5.0/bin/node]
40: 0x1295b33dc
41: 0x10170e8cc Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/24.5.0/bin/node]
42: 0x10170e570 Builtins_JSEntry [/opt/homebrew/Cellar/node/24.5.0/bin/node]
43: 0x100eed93c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
44: 0x100eed32c v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::DirectHandle<v8::internal::Object>, v8::base::Vector<v8::internal::DirectHandle<v8::internal::Object> const>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
45: 0x100dc9fe0 v8::Function::Call(v8::Isolate, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
46: 0x100bcc970 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
47: 0x100bccbb0 node::InternalMakeCallback(node::Environment, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
48: 0x100bdba5c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
49: 0x100d3e35c node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
50: 0x100d3f90c node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
51: 0x100d9c9f8 node::crypto::TLSWrap::ClearOut() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
52: 0x100d9be90 node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
53: 0x100d9e648 node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
54: 0x100d420d0 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
55: 0x100d4258c node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s, long, uv_buf_t const) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
56: 0x105dafaf0 uv__stream_io [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
57: 0x105db6ca8 uv__io_poll [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
58: 0x105da6b58 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
59: 0x100bcd3ec node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
60: 0x100cae0e8 node::NodeMainInstance::Run(node::ExitCode, node::Environment) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
61: 0x100cade7c node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
62: 0x100c54318 node::Start(int, char**) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
63: 0x19ec85924 start [/usr/lib/dyld]
<img width="617" height="188" alt="Image" src="https://github.com/user-attachments/assets/08e35254-901c-4e3b-9785-904531f11b34" />
This is ridiculous - we should be able to downgrade when it is broken (as it currently is with the heap issue).
@bcherny please assign someone to this
Claude code is currently unusable for the task I have assigned it
Just want to mention for the sh method of binary installation this type of error will still occur. It will just crash and say core dumped. As of 1.0.77
@rayozzie ok bud 👍
brb, buying another 128GB.
Details on how it happened for me:
NODE_OPTIONS=--max-old-space-sizedidn't helpnpm test)--verbose -dto see what it crashes on, and it didn't crash 😁Definitely still eating well, though.
I found a temporary workaround (at least for my case). Use claude-code-sdk to start with your prompt. Don't use the terminal claude code directly.
My repo hit this "memory-leak" crash 100%. And then switching to
claude-code-sdk, it can run and finish the task.BTW, my repo starts multiple
Task()call with subagent. This is my use case.try 1.0.83 on mac, for me, npm installed claude code well controls its ram usage, I have not seen over 4GB of usage during a whole day.
We provisionally think this is fixed as of 1.0.83; please keep letting us know if you see issues on later versions! Thanks for your patience on this
❯ claude --version
1.0.89 (Claude Code)
and seeing this MULTIPLE times an hour!!!!
`
<--- Last few GCs --->
[23398:0x150018000] 547277 ms: Scavenge (interleaved) 4050.7 (4089.9) -> 4044.5 (4127.4) MB, pooled: 0 MB, 20.00 / 0.00 ms (average mu = 0.227, current mu = 0.159) allocation failure;
[23398:0x150018000] 547896 ms: Mark-Compact (reduce) 4071.9 (4127.6) -> 4053.1 (4078.6) MB, pooled: 0 MB, 590.96 / 0.00 ms (+ 0.5 ms in 436 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 619 ms) (average mu = 0.216,
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x104f7fbf4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
2: 0x1050ba880 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
3: 0x1050ba838 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
4: 0x105297454 v8::internal::Heap::stack() [/opt/homebrew/Cellar/node/24.6.0/bin/node]
5: 0x105299b94 v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/24.6.0/bin/node]
6: 0x105299a34 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
7: 0x1052a73c0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/opt/homebrew/Cellar/node/24.6.0/bin/node]
8: 0x1052a7064 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack, void, void const*) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
9: 0x1059ef55c PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/24.6.0/bin/node]
10: 0x105295a14 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
11: 0x105216684 v8::internal::StackGuard::HandleInterrupts(v8::internal::StackGuard::InterruptLevel) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
12: 0x1055e7cb0 v8::internal::Runtime_StackGuardWithGap(int, unsigned long, v8::internal::Isolate) [/opt/homebrew/Cellar/node/24.6.0/bin/node]
13: 0x105ab1f74 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/24.6.0/bin/node]
14: 0x1279cc5bc
15: 0x127ca05e8
16: 0x127fd43e8
17: 0x127e6383c
18: 0x128004e04
19: 0x1281a9230...`
@dhollman , the issue persists in version 1.0.89. In my repo (using Task() to call sub-agent in parallel), it happens not only multiple time, but everytime. Now, I can only use
claude-code-sdkto run my repo via script.<--- Last few GCs --->
[152947:0x8d06180] 84978582 ms: Mark-Compact 2029.8 (2085.8) -> 2027.7 (2085.8) MB, 804.06 / 0.00 ms (average mu = 0.089, current mu = 0.003) allocation failure; scavenge might not succeed
[152947:0x8d06180] 84979433 ms: Mark-Compact 2030.0 (2086.0) -> 2027.9 (2086.0) MB, 848.19 / 0.00 ms (average mu = 0.046, current mu = 0.003) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0xb8cf03 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [claude]
2: 0xf04610 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [claude]
3: 0xf048f7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [claude]
4: 0x1116545 [claude]
5: 0x1116ad4 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [claude]
6: 0x112d9c4 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [claude]
7: 0x112e1dc v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [claude]
8: 0x11044e1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [claude]
9: 0x1105675 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [claude]
10: 0x10e2cc6 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [claude]
11: 0x153e806 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [claude]
12: 0x7c1d0fed9ef6
Aborted (core dumped)
claude --version
1.0.89 (Claude Code)
Aborted()
<--- Last few GCs --->
[60384:0x7fce00008000] 296315 ms: Scavenge (interleaved) 8176.6 (8196.3) -> 8173.3 (8196.8) MB, pooled: 0 MB, 11.10 / 0.00 ms (average mu = 0.267, current mu = 0.244) allocation failure;
[60384:0x7fce00008000] 299517 ms: Mark-Compact 8177.0 (8196.8) -> 8169.0 (8195.1) MB, pooled: 2 MB, 3172.17 / 0.00 ms (average mu = 0.186, current mu = 0.080) allocation failure; scavenge might not succeed
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x105ec91b9 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/local/Cellar/node/24.4.1/bin/node]
2: 0x104b915ef v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [/usr/local/Cellar/node/24.4.1/bin/node]
3: 0x104b915b0 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/usr/local/Cellar/node/24.4.1/bin/node]
4: 0x104d6da57 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/Cellar/node/24.4.1/bin/node]
5: 0x104d70464 v8::internal::Heap::OldGenerationConsumedBytes() const [/usr/local/Cellar/node/24.4.1/bin/node]
6: 0x104d702e9 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/usr/local/Cellar/node/24.4.1/bin/node]
7: 0x104d7e99d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/usr/local/Cellar/node/24.4.1/bin/node]
8: 0x104d7e62d void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack, void, void const*) [/usr/local/Cellar/node/24.4.1/bin/node]
9: 0x1055092d6 PushAllRegistersAndIterateStack [/usr/local/Cellar/node/24.4.1/bin/node]
10: 0x104d6bf65 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/Cellar/node/24.4.1/bin/node]
11: 0x104d633bd v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/24.4.1/bin/node]
12: 0x104d4a355 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/Cellar/node/24.4.1/bin/node]
13: 0x1050e7e90 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [/usr/local/Cellar/node/24.4.1/bin/node]
14: 0x1055d67f6 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/usr/local/Cellar/node/24.4.1/bin/node]
15: 0x105603e2a Builtins_ArrayPrototypeJoin [/usr/local/Cellar/node/24.4.1/bin/node]
Additional Crash Report - macOS
Experiencing the same recurring JavaScript heap out of memory crashes described in this issue.
Environment:
Crash Details:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryStack Trace Key Points:
<--- Last few GCs --->
[85291:0x110008000] 10996266 ms: Mark-Compact (reduce) 4080.9 (4101.3) -> 4080.9 (4098.3) MB, pooled: 0 MB, 14.12 / 0.00 ms (average
mu = 0.764, current mu = 0.003) last resort; GC in old space requested
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Notable stack entries:
Pattern Match:
This crash shows the exact same symptoms as other reports in this thread - V8 heap exhaustion during normal operation with failed
garbage collection attempts. The
StreamBase::Writevoperation in the stack trace suggests it may be related to output buffermanagement during long-running operations.
Hope this additional data point helps with debugging the underlying memory leak.
The same error still occurs in 1.0.111. My single point observation led me to believe that a single streamlined general-purpose agent will not trigger this crash, but parallel subagents will likely to trigger.
For devs in Claude Code, please try this hook which will supervise identifying potential for parallel execution of subtasks: https://github.com/anthropics/claude-code/issues/5692#issuecomment-3275373279
Edit: i think this behavior is related to prolonged running sessions. instead of several
/compactor/clear, more proactive close and reopen a freshclaudewill work much better. In fact I've never seen this OOS since this approach.I'm still getting it in 1.0.115
I am still getting in the latest version.
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x1032a060c node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
2: 0x103435710 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
3: 0x1035f274c v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
4: 0x1035f81e4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/opt/homebrew/Cellar/node/23.7.0/bin/node]
5: 0x1035f2a90 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack, void, void const*) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
6: 0x1031b8028 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/23.7.0/bin/node]
7: 0x1035ef978 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
8: 0x1035e93c0 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
9: 0x1035e9d88 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
10: 0x1035dae34 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
11: 0x10389dc4c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
12: 0x1030979f4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/23.7.0/bin/node]
13: 0x1030a1930 Builtins_CreateDataProperty [/opt/homebrew/Cellar/node/23.7.0/bin/node]
14: 0x10305af18 Builtins_CloneObjectIC_Slow [/opt/homebrew/Cellar/node/23.7.0/bin/node]
15: 0x10bebb8b4
16: 0x10bebaec8
17: 0x10c9276c0
18: 0x10c3097f8
19: 0x10c8a9584
20: 0x10bc87780
21: 0x10bd73164
22: 0x10b93ed54
23: 0x10c6f5cb8
24: 0x10303de20 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/23.7.0/bin/node]
25: 0x10310b298 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/23.7.0/bin/node]
26: 0x10302d214 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/23.7.0/bin/node]
27: 0x102ffe3f0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/23.7.0/bin/node]
28: 0x103567638 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
29: 0x103567da4 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
30: 0x103592358 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
31: 0x103002aac Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/23.7.0/bin/node]
32: 0x10c8252bc
33: 0x102ffe50c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/23.7.0/bin/node]
34: 0x102ffe1b0 Builtins_JSEntry [/opt/homebrew/Cellar/node/23.7.0/bin/node]
35: 0x103567660 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
36: 0x103566fc8 v8::internal::Execution::Call(v8::internal::Isolate, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
37: 0x10344c250 v8::Function::Call(v8::Isolate, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
38: 0x1031b96d4 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/23.7.0/bin/node]
39: 0x1031b9b94 node::InternalMakeCallback(node::Environment, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
40: 0x1031d1c9c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
41: 0x1033a5004 node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
42: 0x1033a5288 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
43: 0x10341b054 node::crypto::TLSWrap::ClearOut() [/opt/homebrew/Cellar/node/23.7.0/bin/node]
44: 0x10341b500 node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node/23.7.0/bin/node]
45: 0x103419b30 node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
46: 0x1033ab670 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
47: 0x1033ab378 node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s, long, uv_buf_t const) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
48: 0x106942e6c uv__stream_io [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
49: 0x10694a0e0 uv__io_poll [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
50: 0x106939f08 uv_run [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
51: 0x1031ba488 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
52: 0x1032e7d94 node::NodeMainInstance::Run(node::ExitCode, node::Environment) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
53: 0x1032e7ae8 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/23.7.0/bin/node]
54: 0x103260be4 node::Start(int, char**) [/opt/homebrew/Cellar/node/23.7.0/bin/node]
55: 0x19d67ab98 start [/usr/lib/dyld]
zsh: abort claude --dangerously-skip-permissions
syedfahimanwer@MacBook-Pro-6 propel-affiliate-content-factory %
Seeing this repeatedly with 1.0.120
I found one of the reason is subagents invoke another subagent inside it, which causes the issue and Aborts the claude code
2.0.5 (Claude Code)
Ubuntu 22.04.5 LTS
Same here
same
same here; macos m2 max 32gb ram
Same, Win11 64GB of memory.
same here.
version: v2.0.27
os: macos m2 max 64gb
same here also. Crashing at 4GB when reaching 100% memory utilization.
Version: 2.0.27
OS: Win 11 ent.
32GB memory
Version: 2.0.28
OS: MacOS 26.0.1
64GB memory
Same here.
<--- Last few GCs --->
[14584:0000022D8B96D000] 59257 ms: Mark-Compact 2043.6 (2090.7) -> 2043.6 (2091.0) MB, pooled: 0 MB, 31.32 / 0.00 ms (average mu = 0.591, current mu = 0.266) allocation failure; scavenge might not succeed
[14584:0000022D8B96D000] 59297 ms: Mark-Compact 2046.9 (2094.1) -> 2046.9 (2094.3) MB, pooled: 0 MB, 32.69 / 0.00 ms (average mu = 0.455, current mu = 0.176) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 00007FF73D9570F7 node::SetCppgcReference+18039
2: 00007FF73D8BAA18 v8::base::CPU::num_virtual_address_bits+102920
3: 00007FF73E4BF151 v8::Isolate::ReportExternalAllocationLimitReached+65
4: 00007FF73E4ABCD6 v8::Function::Experimental_IsNopFunction+3302
5: 00007FF73E308420 v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+33904
6: 00007FF73E304AAA v8::internal::StrongRootAllocatorBase::StrongRootAllocatorBase+19194
7: 00007FF73E31B08C v8::Isolate::GetHeapProfiler+8012
8: 00007FF73E31B90A v8::Isolate::GetHeapProfiler+10186
9: 00007FF73E3269F1 v8::Isolate::GetHeapProfiler+55473
10: 00007FF73E336746 v8::Isolate::GetHeapProfiler+120326
11: 00007FF73E33B558 v8::Isolate::GetHeapProfiler+140312
12: 00007FF73E23231B v8::Object::GetIsolate+372411
13: 00007FF73E22F26D v8::Object::GetIsolate+359949
14: 00007FF73E232594 v8::Object::GetIsolate+373044
15: 00007FF73E462515 v8::SharedValueConveyor::SharedValueConveyor+265589
16: 00007FF73E462790 v8::SharedValueConveyor::SharedValueConveyor+266224
17: 00007FF6DE52D3FA
Fixed with command in power shell
$env:NODE_OPTIONS="--max-old-space-size=8192"
Heap Out of Memory Crashes - The Long Session Killer
53 comments. 29 reactions. Recurring crash.
10+ stack traces provided. All show the same pattern: Node.js heap exhausted during long sessions.
Root Cause Analysis
Looking at the stack traces, the crash happens in:
This means JavaScript objects are being allocated faster than GC can collect them.
What's leaking:
Why Default Node Heap Isn't Enough
Node.js defaults to ~2GB heap on 64-bit systems. Claude Code sessions with:
...can easily hit 2-3GB in a few hours.
Immediate Workaround
Increase Node.js heap limit:
This buys you more time before crash.
Even better - add to shell profile:
Architectural Fix (For Anthropic)
Implement conversation windowing:
This keeps memory constant regardless of session length.
Monitoring Solution
Add memory tracking to detect leaks early:
If memory grows >500MB/hour steadily → leak confirmed.
Emergency Recovery
If Claude Code crashes mid-session:
(If
--resumedoesn't exist, manually load the session file)Long-term Fix: Streaming Architecture
Instead of keeping everything in memory:
This prevents unbounded memory growth.
Verify the Fix
After applying NODE_OPTIONS workaround:
Why This Keeps Getting Closed
The issue is intermittent because it depends on:
Short sessions don't trigger it, so it seems "fixed" - but it's not.
---
Action: Use
NODE_OPTIONS="--max-old-space-size=8192"immediately. Report back if still crashes (then it's a different leak).I recommend using Codex, doesnt have this issue.
this started happening when i switched to using a lot of sub agents with skills.
I can't start any convos now with out it crashing after the first message
Same here, crashing a few seconds after startup.
Happening extremely commonly for me as well when spinning up a couple agents.
this might help someone, there is a workaround - simply renaming the project's absolute path to something else - fixed the issue for me, tho it might reset some of claude settings to default, it was the only solution worked for me.
Still happening on v2.1.68 + Node.js v24.14.0 — OOM after 21-hour session
Environment: Windows 11, Claude Code v2.1.68 via npm (Node.js runtime, NOT Bun), Node.js v24.14.0
Crash output:
Session runtime: 76,271,552 ms = 21.2 hours. Heap at crash: ~455 MB. The default V8 semi-space is too small for long sessions with heavy tool use (subagents, file reads, bash commands).
Context: I switched from the native Bun binary to npm/Node.js after 49 Bun segfault crashes in 33 days (#21576). Node.js eliminated the segfaults but now I'm hitting this OOM on long sessions instead. The crash also corrupts the terminal — same
[O[ICSI escape code leak as Bun crashes, because the Ink TUI doesn't clean up on any crash path.v2.1.63 shipped 11 memory leak fixes. v2.1.68 still OOMs. The root cause analysis in #25926 is excellent —
mutableMessagesarray grows monotonically, SDKreceivedMessages[]never dereferenced, tool results under 400KB stay in RAM forever, file history snapshots never trimmed. None of these appear to have been fully addressed.Workaround:
export NODE_OPTIONS="--max-old-space-size=4096"in shell profile. But as @ulshv noted earlier in this thread, increasing the heap just delays the inevitable — the leak will fill whatever you give it.This issue has been open since June 2025 — 9 months. It has the
oncalllabel. When does oncall actually result in a fix?JavaScript heap out of memory during thinking is usually caused by long conversations or large context accumulation. Here are mitigations:
Workaround 1 — Increase Node.js heap size:
This increases the V8 heap limit from the default (~4GB) to 8GB. Adjust the number based on your system's RAM.
Workaround 2 — Compact proactively:
Long conversations accumulate memory. Compacting before the heap runs out prevents crashes. A good rule of thumb: compact every 20-30 exchanges.
Workaround 3 — SessionStart hook to set memory limit:
Workaround 4 — Start fresh sessions for new tasks:
Rather than continuing a single long session, start new sessions for each task:
Each session starts with a clean heap. The most reliable way to avoid OOM.
Workaround 5 — Monitor memory with a hook:
This warns you when memory usage exceeds 4GB, giving you a chance to compact before OOM.
On macOS specifically: macOS may not report the full heap usage accurately. If crashes persist even with increased heap size, check Activity Monitor for the
claudeprocess memory.Reproducing on Windows with multiple agent windows. Each Claude Code window is an independent node.exe process. With 6+ simultaneous agent windows + active Python pipeline processes, heap exhaustion is predictable and repeatable. The multi-window model means RAM usage scales linearly with open windows — there's no shared heap. Observed: 6 windows × ~800MB each = 4.8GB just for Claude Code, on top of heavy Python pipeline work. Workaround: limit to 1-2 Claude Code windows while running intensive background processes.
Another occurrence on v2.1.90 (April 2, 2026, Windows 11). 10+ agent windows running overnight pipeline work — all crashed simultaneously. Multiple terminals flooded with raw comma-separated numbers (buffer dump, not application output). Every agent session dead at once, including the bug-reporter, so the crash couldn't even be reported in real-time.
This is a recurring issue — same user reports this has happened 'a million times' and is the reason they run with auto-updates disabled and npm-only installs. The multi-window Bun runtime simply cannot sustain 10+ concurrent sessions with active file I/O and Python pipeline work.
10 windows x ~800MB each = 8+ GB for Claude Code alone, plus 12+ GB of Python pipeline processes on 34 GB RAM. Bun's memory management can't handle it.
Still crashing on v2.1.92 (April 3, 2026, Windows 11). Multiple windows + active pipeline work = full system crash. Raw data floods terminals. This is the fifth consecutive release (v2.1.89 through v2.1.92) with no improvement to multi-window Bun runtime stability on Windows.
+1, hitting this on macOS with v2.1.128 — over a month after this was opened with the
oncalllabel and it's still crashing the CLI mid-session. Frustrating because there's nothing user-actionable in the TUI when it happens — Claude just vanishes and you lose the session.Same V8 OOM signature as OP. From the macOS DiagnosticReports
.ips:CheckIneffectiveMarkCompactis the giveaway — V8 was trying to GC and couldn't free anything, so itabort()'d. Classic heap-fragmented-after-long-session pattern.What I had to figure out on my own
~/.claude/logs/doesn't exist.~/.claude/debug/latestis a symlink pointing to a.txtthat has already been deleted. The only forensic trail is the macOS DiagnosticReports.ips— and only if you know to look there.claude doctorsays nothing about prior crashes.~/.claude/sessions/*.jsonmarked"status":"busy"— one had been running for many hours at ~450 MB RSS. Combined RSS across instances was marching steadily toward the V8 heap ceiling. Nothing reaps them. Nothing warns the user.alwaysThinkingEnabled, a non-trivialCLAUDE.md, and long sessions, you blow through it. The only fix isNODE_OPTIONS=--max-old-space-size=8192— which isn't documented anywhere as a recommended setting and isn't surfaced by/doctor.Asks that would actually help
--max-old-space-sizefor the bundled launcher, or auto-set it based on system RAM. 4 GB is a 2015 default.~/.claude/sessions/*.jsonentries whose PIDs are dead at startup, and warn when N>3 live instances exist (compounding heap pressure).CheckIneffectiveMarkCompactGC pressure and surface it in/doctoror as a TUI warning before the abort. V8 emits warnings on stderr that get swallowed by the TUI./compacttrigger when heap usage crosses a threshold. Right now compaction only runs on context-window pressure, not on RSS.