Node.js Memory Allocation Failure During File Writing
Bug Description
Since June 4th, I've been experiencing issues:
1- having to re-authenticate every time I launch Claude Code, if I'm already running claude code and launch a second instance it still happens.
2- I also have to go through the initial setup as if it was the first time I was executing claude code.
3- Sometime when writing files this happens (happened 4-5 times already), so far it has only happened when writing documentation files and it never happened before yesterday. (Was this introduced with an update? Connection issues caused by increased traffic due to Claude Code becoming available to Claude Pro?)
The logs after Node.JS encounters memory limitation and Claude Code crashes:
<--- Last few GCs --->
[70320:0x556c48795000] 3676078 ms: Mark-Compact 3894.9 (4134.6) -> 3879.1 (4135.1) MB, pooled: 0 MB, 162.75 / 0.04 ms (average mu = 0.208, current mu = 0.182) allocation failure; scavenge might not succeed
[70320:0x556c48795000] 3676384 ms: Mark-Compact 3895.2 (4135.1) -> 3879.3 (4134.8) MB, pooled: 1 MB, 266.05 / 0.04 ms (average mu = 0.163, current mu = 0.131) 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: 0x7f90f84a6428 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/lib64/libnode.so.127]
2: 0x7f90fa6b9b84 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, v8::OOMDetails const&) [/lib64/libnode.so.127]
3: 0x7f90fa6b9e7a v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/lib64/libnode.so.127]
4: 0x7f90fa90239b [/lib64/libnode.so.127]
5: 0x7f90fa9023d8 v8::internal::Heap::ReportIneffectiveMarkCompactIfNeeded() [/lib64/libnode.so.127]
6: 0x7f90fa91c9fe [/lib64/libnode.so.127]
7: 0x7f90fa91f5ac [/lib64/libnode.so.127]
8: 0x7f90fb2bc897 [/lib64/libnode.so.127]
[1] 70320 IOT instruction (core dumped) /home/user/.claude/local/claude --continue.
Edit: I have only encountered the issue number 3 in vscode, I've finished creating my documentation using Claude Code in the terminal and no crash occured, but the memory usage for that particular Node JS instance was above 3 GB and did not seem to shrink even after compacting instead it increased from 3.1GB to 3.4GB.
Monitoring the Memory usage of Claude Code during various other tasks like implementation or performing tests, everything has been normal, no memory issues using bash, read files, search or update files.
Environment Info
- Platform: linux fedora 42 and system memory 32 GB
- Terminal: vscode
- Version: 1.0.11
- Feedback ID: cae07fa5-490d-4606-a3fb-ed7eb1ec4d5e
Errors
[{"error":"Error: Insufficient permissions for global npm install.\n at M1A (file:///home/user/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1963:977)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async file:///home/user/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2003:1050","timestamp":"2025-06-05T16:00:40.802Z"}]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗