[BUG] exceptional memory usage since v2.0.8

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Oct 5, 2025 · closed Jan 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

each instance of claude code is using anywhere from 2.5-3GB to 8GB of RAM, on a MacBook Pro M4 Pro with built-in GPU. nothing has changed on my macbook other than claude code auto-update, whenever that happened. See this:

<img width="861" height="686" alt="Image" src="https://github.com/user-attachments/assets/96ebda64-1956-4653-b63c-d26cedaec3e8" />

What Should Happen?

if 1 claude code terminal takes up on an average 4-5 GB of Memory, MacBooks are not just running out of battery but there's not much we can do with claude code in 1 terminal !

Error Messages/Logs

provided from activity monitor all details.

Steps to Reproduce

just launch claude code in macos terminal or warp terminal, then watch activity monitor.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.8

Claude Code Version

2.0.8 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

12 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8542
  2. https://github.com/anthropics/claude-code/issues/8836
  3. https://github.com/anthropics/claude-code/issues/8737

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

saynth-ai · 10 months ago

<--- Last few GCs --->

[2184614:0x33dc9000] 694035870 ms: Mark-Compact 4081.4 (4111.3) -> 4064.5 (4121.4) MB, pooled: 0 MB, 122.74 / 0.09 ms (average mu = 0.397, current mu = 0.416) allocation failure; scavenge might not succeed
[2184614:0x33dc9000] 694036016 ms: Mark-Compact (reduce) 4081.5 (4125.0) -> 4073.0 (4095.0) MB, pooled: 0 MB, 28.58 / 0.01 ms (+ 62.3 ms in 217 steps since start of marking, biggest step 5.2 ms, walltime since start of marking 134 ms) (average mu = 0.390
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0xf41253 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [claude]
2: 0x1388b50 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [claude]
3: 0x1388c3f v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [claude]
4: 0x1621705 [claude]
5: 0x1621732 [claude]
6: 0x1621a2a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [claude]
7: 0x1631f4a [claude]
8: 0x16362f0 [claude]
9: 0x20c8ff1 [claude]
Aborted

ariccio · 10 months ago

Yeah, wow, mine dumped core too:

<--- Last few GCs --->

[18225:0x128008000]  4254158 ms: Scavenge (reduce) 3728.9 (3760.7) -> 3727.9 (3760.7) MB, 0.96 / 0.00 ms  (average mu = 0.935, current mu = 0.952) allocation failure; 
[18225:0x128008000]  4254793 ms: Mark-Compact (reduce) 4439.1 (4471.0) -> 4230.8 (4387.7) MB, 105.25 / 0.04 ms  (average mu = 0.941, current mu = 0.950) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

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

 1: 0x1042415b8 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 2: 0x1043ff968 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 3: 0x10460d7bc v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 4: 0x10460c124 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 5: 0x104601fc0 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 6: 0x104602818 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 7: 0x1045e65a8 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 8: 0x1045d99d8 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
 9: 0x1045f3410 v8::internal::Factory::NewJSArray(v8::internal::ElementsKind, int, int, v8::internal::ArrayStorageAllocationMode, v8::internal::AllocationType) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
10: 0x104a03620 v8::internal::Runtime_StringSplit(int, unsigned long*, v8::internal::Isolate*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
11: 0x104d88c44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
12: 0x104d7a1bc Builtins_StringPrototypeSplit [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
13: 0x10a7682e4 
14: 0x10a5b3c90 
15: 0x109f53044 
16: 0x109f4835c 
17: 0x10a03996c 
18: 0x10a04bf5c 
19: 0x10a01dce8 
20: 0x10a4dc77c 
21: 0x109e68424 
22: 0x10a454420 
23: 0x10a5a65bc 
24: 0x10a6677a0 
25: 0x10a0dd280 
26: 0x10a8b5280 
27: 0x109e68264 
28: 0x10a454420 
29: 0x10a5a65bc 
30: 0x10a5d0fd8 
31: 0x109b7a6a8 
32: 0x104cfe50c Builtins_JSEntryTrampoline [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
33: 0x104cfe1f4 Builtins_JSEntry [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
34: 0x104578274 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
35: 0x104577b08 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
36: 0x10441b998 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
37: 0x104158fdc node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
38: 0x10416d30c node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
39: 0x10432a3c8 node::StreamBase::CallJSOnreadMethod(long, v8::Local<v8::ArrayBuffer>, unsigned long, node::StreamBase::StreamBaseJSChecks) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
40: 0x10432bb44 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
41: 0x104330380 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
42: 0x104330a98 node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s*, long, uv_buf_t const*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
43: 0x104ce7f44 uv__stream_io [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
44: 0x104cefbd0 uv__io_poll [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
45: 0x104cdd490 uv_run [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
46: 0x1041597e8 node::SpinEventLoopInternal(node::Environment*) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
47: 0x104285eec node::NodeMainInstance::Run() [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
48: 0x104203cfc node::Start(int, char**) [/Users/alexanderriccio/.nvm/versions/node/v20.19.4/bin/node]
49: 0x191642b98 start [/usr/lib/dyld]
zsh: abort      scripts/claude-mcp-select.sh -xcb
Exit status: 134
ariccio · 10 months ago

"if 1 claude code terminal takes up on an average 4-5 GB of Memory, MacBooks are not just running out of battery but there's not much we can do with claude code in 1 terminal !"

Isn't it great to live in 2025 where we have the literal holy grail of AI at our fingertips but also everything is javascript and garbage collection?

SkyTik · 10 months ago

<img width="2144" height="1504" alt="Image" src="https://github.com/user-attachments/assets/b87d11e1-2f58-4766-87dc-251d4823aef9" /> running into the same issues if switching between repository with opening claude extension in Cursor

ardasevinc · 10 months ago

I'm also seeing 1-2 GB of memory usage per session. this is insane.

flip-in · 10 months ago

<img width="745" height="671" alt="Image" src="https://github.com/user-attachments/assets/ece831b4-b220-4e1e-97fc-41c808e4102b" />

very high amounts of memory being used

mengxi-ream · 10 months ago
<img alt="Image" width="2000" height="1504" src="https://private-user-images.githubusercontent.com/29628359/499712427-b87d11e1-2f58-4766-87dc-251d4823aef9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjEzNzYxMjAsIm5iZiI6MTc2MTM3NTgyMCwicGF0aCI6Ii8yOTYyODM1OS80OTk3MTI0MjctYjg3ZDExZTEtMmY1OC00NzY2LTg3ZGMtMjUxZDQ4MjNhZWY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDI1VDA3MDM0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM0OTIxZGU4MzU1NmE4YTA0NGViOGFhZjcxMDczZjQ3ZGE5ZGM4ZTY0MDMyYjEyYmFlMmViMzhlNjA5MTY3NGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.COAfDVL3Cp3t1YS-ogO7JGVAedDSV45ynRolZ1-WxF0"> running into the same issues if switching between repository with opening claude extension in Cursor

exactly the same issue when runing claude code inside Cursor

ardasevinc · 9 months ago

this seems to resolved by 2.0.33! im seeing like 300mb of ram usage compared to 1.5-2 gigs on my macbook pro m4

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.