Memory leak: massive ArrayBuffer allocation (~2.26 GB) within 40 seconds of session start

Resolved 💬 4 comments Opened Mar 13, 2026 by aimagist Closed Apr 11, 2026

Description

Claude Code allocated ~2.8 GB of memory (primarily ArrayBuffers) within ~40 seconds of session start, with a reported growth rate of ~97,509 MB/hour.

Diagnostics

Session ID: 68e02f70-c7ad-49e3-aaa4-841619146187
Claude Code version: 2.1.73
Node.js version: v24.3.0
Platform: win32 (Windows 11 Pro 10.0.26200)
Trigger: Manual heap dump

Memory Snapshot

{
  "timestamp": "2026-03-13T02:31:01.214Z",
  "uptimeSeconds": 39.7938422,
  "memoryUsage": {
    "heapUsed": 2999895222,
    "heapTotal": 64576512,
    "external": 2959021302,
    "arrayBuffers": 2426476850,
    "rss": 1130209280
  },
  "memoryGrowthRate": {
    "bytesPerSecond": 28401612.347952668,
    "mbPerHour": 97509.19766676865
  },
  "v8HeapStats": {
    "heapSizeLimit": 13155164160,
    "mallocedMemory": 2999915574,
    "peakMallocedMemory": 1315516416,
    "detachedContexts": 0,
    "nativeContexts": 1
  },
  "activeHandles": 0,
  "activeRequests": 0
}

Analysis

  • heapUsed (~2.8 GB) vastly exceeds heapTotal (~61 MB), indicating the allocations are external to V8's managed heap
  • ArrayBuffers account for ~2.26 GB of the ~2.75 GB external memory — something is allocating large buffers and not releasing them
  • mallocedMemory (~2.8 GB) exceeds peakMallocedMemory (~1.25 GB), confirming memory grew beyond its previous peak in this session
  • No active handles or requests at dump time

Suspected Cause

Single large allocation event (or rapid burst) into ArrayBuffers with a retained reference preventing GC. Possibly related to large file processing, streaming response buffering, or IPC data transfer.

Reproduction

Unknown — the heap dump was triggered manually after noticing high memory usage shortly after session start.

A .heapsnapshot file (36 MB) is available if needed for deeper analysis.

View original on GitHub ↗

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