[Bug] Out of Heap Memory Error in Long-Running Agent Sessions

Resolved 💬 3 comments Opened Jan 7, 2026 by IvanTorresEdge Closed Jan 7, 2026

Bug Description
there seems to be a memory leak, after long sessions I invariably get a crash with heap limit allocation error (I am running my custom marketplace with agents and subagents).

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.0.60
  • Feedback ID: b1520a8b-c89e-407a-9f53-fb4f7444e258

Errors

<--- Last few GCs --->

[22888:0x94480c000] 21439431 ms: Mark-Compact 3924.1 (4204.2) -> 3872.7 (4219.9) MB, pooled: 0 MB, 2390.33 / 0.00 ms  (average mu = 0.442, current mu = 0.371) allocation failure; scavenge might not succeed
[22888:0x94480c000] 21443919 ms: Mark-Compact 3922.3 (4224.7) -> 3889.4 (4234.7) MB, pooled: 8 MB, 3140.62 / 0.00 ms  (average mu = 0.371, current mu = 0.300) allocation failure; GC in old space requested

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

 1: 0x104d388b4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 2: 0x104e6928c v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 3: 0x104e69244 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 4: 0x105046204 v8::internal::Heap::stack() [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 5: 0x105044928 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 6: 0x10503c3cc v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 7: 0x105024058 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 8: 0x105396e18 v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
 9: 0x10585df74 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/24.2.0/bin/node]
10: 0x12b9a6e30 
11: 0x12c22d708 
12: 0x12c200ae8 
13: 0x12c4e3aa0 
14: 0x12c4e179c 
15: 0x12c40a778 
16: 0x12c3eac7c 
17: 0x12c211274 
18: 0x1057be8cc Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/24.2.0/bin/node]
19: 0x1057be570 Builtins_JSEntry [/opt/homebrew/Cellar/node/24.2.0/bin/node]
20: 0x104f9e490 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
21: 0x104f9de80 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.2.0/bin/node]
22: 0x104e7a778 v8::Function::Call(v8::Isolate*, v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
23: 0x104c88bd8 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.2.0/bin/node]
24: 0x104c88ea0 node::InternalMakeCallback(v8::Isolate*, 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.2.0/bin/node]
25: 0x104cecf60 node::Environment::CheckImmediate(uv_check_s*) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
26: 0x10a1b0214 uv__run_check [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
27: 0x10a1aab88 uv_run [/opt/homebrew/Cellar/libuv/1.51.0/lib/libuv.1.dylib]
28: 0x104c893ec node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
29: 0x104d626c0 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
30: 0x104d62454 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/24.2.0/bin/node]
31: 0x104d0e01c node::Start(int, char**) [/opt/homebrew/Cellar/node/24.2.0/bin/node]
32: 0x1831c9d54 start [/usr/lib/dyld]
[1]    22888 abort      claude --continue

View original on GitHub ↗

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