Memory leak: extreme growth rate in external/arrayBuffers from session start

Resolved 💬 4 comments Opened Mar 12, 2026 by poeks Closed Apr 9, 2026

Description

Claude Code shows an extreme memory growth rate starting from the very beginning of a session. Two separate /heapdump snapshots were taken within ~2 minutes of session start, both showing massive memory usage dominated by external memory and arrayBuffers.

Environment

  • Platform: Linux (Ubuntu 24.04)
  • Node.js: v24.3.0
  • Claude Code version: 2.1.72 (also reproduced after updating to 2.1.74)
  • Shell: zsh

Diagnostics

Session 1 (uptime: 106 seconds)

{
  "uptimeSeconds": 106.37,
  "memoryUsage": {
    "rss": 2077622272,
    "heapUsed": 4556004637,
    "heapTotal": 57977856,
    "external": 4512361213,
    "arrayBuffers": 4108542877
  },
  "memoryGrowthRate": {
    "mbPerHour": 67058.9
  }
}

Session 2 (uptime: 115 seconds)

{
  "uptimeSeconds": 115.80,
  "memoryUsage": {
    "rss": 3422146560,
    "heapUsed": 3420422919,
    "heapTotal": 54810624,
    "external": 3379683079,
    "arrayBuffers": 3038033147
  },
  "memoryGrowthRate": {
    "mbPerHour": 101455.1
  }
}

Analysis

  • external memory (~3-4 GB) vastly exceeds heapTotal (~55-58 MB), which is highly abnormal
  • arrayBuffers account for the majority of external memory — this suggests streaming response buffers or similar binary data is not being released
  • Growth rate of 67,000–101,000 MB/hour within the first 2 minutes indicates a leak from the very start of the session, not gradual accumulation
  • /heapdump diagnosis confirms: "WARNING: 1 potential leak indicator(s) found"

Reproduction

  1. Start a new Claude Code session
  2. Run /heapdump within 2 minutes
  3. Observe external and arrayBuffers already in the gigabyte range with extreme growth rate

Impact

On a system with 8 GB RAM, Claude Code consumes 2–3 GB within 2 minutes, making it unusable for extended sessions.

View original on GitHub ↗

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