[BUG] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Resolved 💬 3 comments Opened Aug 6, 2025 by jyyen Closed Aug 15, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: <!-- specify -->

- Claude CLI version: <!-- output of claude --version -->

  • Operating System: macOS 15.6
  • Terminal: iTerm2

Bug Description

<!-- A clear and concise description of the bug -->
crash repeatedly! Memory usage spike up (yellow in actitvity monitor)

Steps to Reproduce

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

Only ask it to research some statistical method (I set up 5 subagents, but limit the spawning to 1 max)

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. -->

<--- Last few GCs --->

[10482:0x118018000] 231154 ms: Mark-Compact 8157.6 (8212.2) -> 8143.7 (8212.9) MB, pooled: 3 MB, 4683.83 / 0.00 ms (average mu = 0.122, current mu = 0.090) allocation failure; scavenge might not succeed
[10482:0x118018000] 236307 ms: Mark-Compact 8159.6 (8212.9) -> 8145.1 (8214.4) MB, pooled: 2 MB, 5046.83 / 0.00 ms (average mu = 0.072, current mu = 0.021) 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: 0x104136b58 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
2: 0x104270af4 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
3: 0x104270aac v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
4: 0x10444d6b0 v8::internal::Heap::stack() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
5: 0x10444fdf0 v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/24.5.0/bin/node]
6: 0x10444fc90 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
7: 0x10445d61c 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: 0x10445d2c0 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: 0x104ba57b8 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/24.5.0/bin/node]
10: 0x10444bc70 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
11: 0x104443878 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
12: 0x1044199e8 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
13: 0x104435648 v8::internal::Handle<v8::internal::PropertyArray> v8::internal::Factory::CopyArrayAndGrow<v8::internal::PropertyArray>(v8::internal::DirectHandle<v8::internal::PropertyArray>, int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
14: 0x10464f3e4 v8::internal::JSObject::MigrateToMap(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSObject>, v8::internal::DirectHandle<v8::internal::Map>, int) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
15: 0x104691bc4 v8::internal::LookupIterator::ApplyTransitionToDataProperty(v8::internal::DirectHandle<v8::internal::JSReceiver>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
16: 0x1046bf184 v8::internal::Object::TransitionAndWriteDataProperty(v8::internal::LookupIterator*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
17: 0x104648940 v8::internal::JSObject::DefineOwnPropertyIgnoreAttributes(v8::internal::LookupIterator*, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::JSObject::AccessorInfoHandling, v8::internal::EnforceDefineSemantics, v8::internal::StoreOrigin) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
18: 0x10465077c v8::internal::JSObject::SetOwnPropertyIgnoreAttributes(v8::internal::DirectHandle<v8::internal::JSObject>, v8::internal::DirectHandle<v8::internal::Name>, v8::internal::DirectHandle<v8::internal::Object>, v8::internal::PropertyAttributes) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
19: 0x1043c6a44 v8::internal::(anonymous namespace)::GetStackFrames(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::FixedArray>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
20: 0x1043c653c 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]
21: 0x1043c8f18 v8::internal::ErrorUtils::GetFormattedStack(v8::internal::Isolate*, v8::internal::DirectHandle<v8::internal::JSObject>) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
22: 0x1042b3a9c v8::internal::Accessors::ErrorStackGetter(v8::FunctionCallbackInfo<v8::Value> const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
23: 0x104bca94c Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/24.5.0/bin/node]
24: 0x138e80860
25: 0x138d6b638
26: 0x138e82c8c
27: 0x138c0e0d0
28: 0x138dd37d4
29: 0x138cb11bc
30: 0x138dd3308
31: 0x138cb8614
32: 0x138d56ac4
33: 0x138db0eb4
34: 0x104bc8bec Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/24.5.0/bin/node]
35: 0x104c07648 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/24.5.0/bin/node]
36: 0x104cdc5f8 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/24.5.0/bin/node]
37: 0x104bf6a50 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/24.5.0/bin/node]
38: 0x104bc67b0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/24.5.0/bin/node]
39: 0x1043a590c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
40: 0x1043a5fb8 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
41: 0x1043a60a8 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate, v8::internal::MicrotaskQueue) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
42: 0x1043caca4 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
43: 0x1043caac0 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
44: 0x104bca94c Builtins_CallApiCallbackOptimizedNoProfiling [/opt/homebrew/Cellar/node/24.5.0/bin/node]
45: 0x138d70ec4
46: 0x104bc68cc Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/24.5.0/bin/node]
47: 0x104bc6570 Builtins_JSEntry [/opt/homebrew/Cellar/node/24.5.0/bin/node]
48: 0x1043a593c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
49: 0x1043a532c 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]
50: 0x104281fe0 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]
51: 0x104084970 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
52: 0x104084bb0 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]
53: 0x104093a5c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
54: 0x1041f635c node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
55: 0x1041f790c node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
56: 0x1042549f8 node::crypto::TLSWrap::ClearOut() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
57: 0x104253e90 node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
58: 0x104256648 node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
59: 0x1041fa0d0 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
60: 0x1041fa58c node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s, long, uv_buf_t const) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
61: 0x1092dbaf0 uv__stream_io [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
62: 0x1092e2ca8 uv__io_poll [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
63: 0x1092d2b58 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
64: 0x1040853ec node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
65: 0x1041660e8 node::NodeMainInstance::Run(node::ExitCode, node::Environment) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
66: 0x104165e7c node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/24.5.0/bin/node]
67: 0x10410c318 node::Start(int, char**) [/opt/homebrew/Cellar/node/24.5.0/bin/node]
68: 0x1866a2b98 start [/usr/lib/dyld]
Abort trap: 6

View original on GitHub ↗

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