claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude Code crashes due to OOM

Open patrickrho opened this issue 6 months ago • 7 comments

Environment

  • Platform (select one):
    • [ x ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ x ] Other: Claude Code
  • Claude CLI version: 1.0.10 (Claude Code)
  • Operating System: MacOS 15.5
  • Terminal: iTerm2

Bug Description

I'm getting the following error when it's generating code

<--- Last few GCs --->

[2579:0x128008000] 973483 ms: Mark-Compact 3777.2 (4137.3) -> 3761.1 (4137.0) MB, 37.21 / 0.00 ms (average mu = 0.373, current mu = 0.366) allocation failure; scavenge might not succeed [2579:0x128008000] 973545 ms: Mark-Compact 3777.5 (4137.5) -> 3761.7 (4137.8) MB, 39.21 / 0.00 ms (average mu = 0.372, current mu = 0.371) 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: 0x100bd20c4 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 2: 0x100d4fdd4 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 3: 0x100d4fd84 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 4: 0x100ee2e98 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 5: 0x100ee58e4 v8::internal::Heap::ComputeMutatorUtilization(char const*, double, double) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 6: 0x100ee3b40 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 7: 0x100ee19c8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 8: 0x100ed9698 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 9: 0x100ed9e04 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 10: 0x100ec2d74 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 11: 0x1011d2bb4 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 12: 0x100a00c44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 13: 0x1088db104 14: 0x1086e7930 15: 0x100a23ee4 Builtins_ArrayMap [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 16: 0x1086e2550 17: 0x108811254 18: 0x108dd9054 19: 0x108a5d048 20: 0x108a8b85c 21: 0x108a9d17c 22: 0x108a20bb0 23: 0x108ce3700 24: 0x1009af210 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 25: 0x100a5cfb8 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 26: 0x10099eb94 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 27: 0x1009763f4 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 28: 0x100e6ec1c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 29: 0x100e6f0ac v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 30: 0x100e905e0 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 31: 0x100e90414 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 32: 0x100da7e80 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 33: 0x100da79d8 v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::FunctionTemplateInfo, v8::internal::Handlev8::internal::Object, unsigned long*, int) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 34: 0x100da77a0 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 35: 0x100a00b24 Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 36: 0x10872dc88 37: 0x10097650c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 38: 0x1009761f4 Builtins_JSEntry [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 39: 0x100e6ec44 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 40: 0x100e6e28c v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 41: 0x100d652a0 v8::Function::Call(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 42: 0x100af0cac node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 43: 0x100af112c node::InternalMakeCallback(node::Environment*, v8::Localv8::Object, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 44: 0x100b06a50 node::AsyncWrap::MakeCallback(v8::Localv8::Function, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 45: 0x100caee04 node::StreamBase::CallJSOnreadMethod(long, v8::Localv8::ArrayBuffer, unsigned long, node::StreamBase::StreamBaseJSChecks) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 46: 0x100caf1b0 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 47: 0x100d258bc node::crypto::TLSWrap::ClearOut() [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 48: 0x100d25d6c node::crypto::TLSWrap::Cycle() [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 49: 0x100d2437c node::crypto::TLSWrap::OnStreamRead(long, uv_buf_t const&) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 50: 0x100cb575c node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 51: 0x100cb53ec node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s*, long, uv_buf_t const*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 52: 0x10389afc8 uv__stream_io [/opt/homebrew/Cellar/libuv/1.49.0/lib/libuv.1.dylib] 53: 0x1038a20d4 uv__io_poll [/opt/homebrew/Cellar/libuv/1.49.0/lib/libuv.1.dylib] 54: 0x1038920b0 uv_run [/opt/homebrew/Cellar/libuv/1.49.0/lib/libuv.1.dylib] 55: 0x100af19d0 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 56: 0x100c16780 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 57: 0x100c16450 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 58: 0x100b95be4 node::Start(int, char**) [/opt/homebrew/Cellar/node@20/20.18.0_1/bin/node] 59: 0x1809d6b98 start [/usr/lib/dyld]

patrickrho avatar Jun 04 '25 05:06 patrickrho