[BUG] JS heap limit allocation failed when running claude code

Resolved 💬 2 comments Opened Jun 8, 2025 by zxdxjtu Closed Jun 9, 2025

Environment

  • Platform (select one):
  • [ ] VS Code terminal
  • Claude CLI version: claude code
  • Operating System: macOS 14.3
  • Terminal: bash

Bug Description

Got JS heap limit stacktrace

<--- Last few GCs --->

[6671:0x7fc234300000] 653090 ms: Mark-Compact 1829.6 (2086.4) -> 1810.8 (2084.1) MB, pooled: 8 MB, 89.20 / 0.07 ms (average mu = 0.994, current mu = 0.965) allocation failure; scavenge might not succeed
[6671:0x7fc234300000] 653250 ms: Mark-Compact 1832.1 (2095.9) -> 1820.5 (2096.1) MB, pooled: 8 MB, 119.69 / 0.00 ms (average mu = 0.985, current mu = 0.250) allocation failure; GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0x106a156d4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/local/bin/node]
2: 0x106c0c998 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/usr/local/bin/node]
3: 0x106e323b7 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
4: 0x106e3050f v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
5: 0x106e23135 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
6: 0x106e23a44 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
7: 0x106df60c2 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawTwoByteInternalizedString(int, unsigned int) [/usr/local/bin/node]
8: 0x106e078a7 v8::internal::Factory::NewInternalizedStringImpl(v8::internal::Handle<v8::internal::String>, int, unsigned int) [/usr/local/bin/node]
9: 0x1071a19c3 v8::internal::InternalizedStringKey::PrepareForInsertion(v8::internal::Isolate*) [/usr/local/bin/node]
10: 0x1071a0a13 v8::internal::Handle<v8::internal::String> v8::internal::StringTable::LookupKey<v8::internal::InternalizedStringKey, v8::internal::Isolate>(v8::internal::Isolate, v8::internal::InternalizedStringKey) [/usr/local/bin/node]
11: 0x1071a0847 v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [/usr/local/bin/node]
12: 0x1072aa603 v8::internal::Runtime_GetProperty(int, unsigned long, v8::internal::Isolate) [/usr/local/bin/node]
13: 0x1077aee36 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
14: 0x11669d27d
15: 0x11685b537
16: 0x116856a4a
17: 0x11682dfa8

Steps to Reproduce

  1. <!-- First step -->
  2. <!-- Second step -->
  3. <!-- And so on... -->

Expected Behavior

<!-- What you expected to happen -->

Actual Behavior

<!-- What actually happened -->

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗