[Bug] High memory usage and CPU spinning in Node.js event loop during garbage collection
Bug Description
Analysis of sampling node (pid 29697) every 1 millisecond
Process: node [29697]
Path: /opt/homebrew/*/node
Load Address: 0x10010c000
Identifier: node
Version: 0
Code Type: ARM64
Platform: macOS
Parent Process: zsh [29623]
Target Type: live task
Date/Time: 2025-12-14 19:12:40.287 -0800
Launch Time: 2025-12-08 08:44:43.177 -0800
OS Version: macOS 15.6 (24G84)
Report Version: 7
Analysis Tool: /usr/bin/sample
Physical footprint: 491.0M
Physical footprint (peak): 578.4M
Idle exit: untracked
----
Call graph:
7340 Thread_24372702 DispatchQueue_1: com.apple.main-thread (serial)
- 7340 start (in dyld) + 6076 [0x18420ab98]
- 7340 node::Start(int, char**) (in node) + 608 [0x100199478]
- 7340 node::NodeMainInstance::Run() (in node) + 124 [0x1001ee514]
- 7340 node::NodeMainInstance::Run(node::ExitCode, node::Environment) (in node) + 184 [0x1001ee780]
- 7340 node::SpinEventLoopInternal(node::Environment*) (in node) + 240 [0x10011540c]
- 6138 uv_run (in libuv.1.0.0.dylib) + 276 [0x103f2aa00]
- ! 6108 uv__io_poll (in libuv.1.0.0.dylib) + 724 [0x103f38bd4]
- ! : 6108 kevent (in libsystem_kernel.dylib) + 8 [0x18456fd04]
- ! 22 uv__io_poll (in libuv.1.0.0.dylib) + 1320 [0x103f38e28]
- ! : 22 uv__async_io (in libuv.1.0.0.dylib) + 276 [0x103f2a58c]
- ! : 22 node::PerIsolatePlatformData::FlushForegroundTasksInternal() (in node) + 764 [0x10020df2c]
- ! : 22 node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task>) (in node) + 224 [0x10020ee30]
- ! : 15 v8::internal::MinorGCJob::Task::RunInternal() (in node) + 144 [0x1004fe5a0]
- ! : | 15 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) (in node) + 428 [0x1004b3b6c]
- ! : | 15 PushAllRegistersAndIterateStack (in node) + 40 [0x100b1a618]
- ! : | 15 heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack, void, void const*) (in node) + 40 [0x1004c4b00]
- ! : | 15 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const (in node) + 512 [0x1004c4d18]
- ! : | 15 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) (in node) + 796 [0x1004b695c]
- ! : | 15 v8::internal::Heap::Scavenge() (in node) + 384 [0x1004b714c]
- ! : | 7 v8::internal::ScavengerCollector::CollectGarbage() (in node) + 2548 [0x10051e8c8]
- ! : | + 7 v8::platform::DefaultJobHandle::Join() (in node) + 28 [0x100d19394]
- ! : | + 6 v8::platform::DefaultJobState::Join() (in node) + 484 [0x100d18f08]
- ! : | + ! 6 v8::internal::ScavengerCollector::JobTask::Run(v8::JobDelegate*) (in node) + 412 [0x10051863c]
- ! : | + ! 3 v8::internal::ScavengerCollector::JobTask::ProcessItems(v8::JobDelegate*, v8::internal::Sca
Environment Info
- Platform: darwin
- Terminal: tmux
- Version: 2.0.69
- Feedback ID:
Errors
[{"error":"AxiosError: Request failed with status code 403\n at vj (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:56:1137)\n at Unzip.<anonymous> (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:57:9852)\n at Unzip.emit (node:events:520:35)\n at Unzip.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1701:12)\n at proces
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗