[BUG] Memory leak: multiple Claude processes accumulate 11GB+ RSS on Ubuntu 25.10 (kernel 6.17)

Resolved 💬 4 comments Opened Feb 15, 2026 by ppravdin Closed Mar 15, 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?

After extended use (1-2 days), Claude Code processes accumulate massive memory. Multiple concurrent claude processes grow unbounded, with the oldest reaching 4.1GB RSS each, totaling ~11.6GB RSS across all processes. Swap is completely exhausted (8GB/8GB) and the system becomes sluggish.

Key observation: memory growth appears proportional to session age — older sessions (started Feb 13) use 1-4GB each, while newer sessions use 400-500MB.

Environment

| Detail | Value |
|--------|-------|
| Claude Code Version | 2.1.42 |
| OS | Ubuntu 25.10 (Questing) |
| Kernel | 6.17.0-7-generic |
| Runtime | Bun 1.3.6 |
| CPU | Intel Core Ultra 7 258V (8 cores) |
| RAM | 30GB |
| Swap | 8GB (100% used) |

Process Snapshot

USER    PID    %CPU %MEM    VSZ        RSS       START  COMMAND
p       9279   8.3  13.4  83365944   4295020   Feb13   claude -c
p       127751 5.8  8.0   78578312   2570656   Feb13   claude
p       715595 3.3  5.9   76638160   1892576   00:12   claude -c
p       82381  3.2  3.4   76655260   1111632   Feb13   claude -c
p       627516 2.9  1.4   75750552   472268    Feb14   claude
p       898717 45.3 1.4   75844176   464844    11:04   claude

Each main claude process also spawns MCP child processes (200-300MB each), adding to the total.

Memory Summary

              total   used   free   shared  buff/cache  available
Mem:          30Gi    22Gi   5.2Gi  581Mi   3.4Gi       7.6Gi
Swap:         8.0Gi   8.0Gi  48Mi

Steps to Reproduce

  1. Start Claude Code on Ubuntu 25.10
  2. Run multiple concurrent sessions in separate terminals
  3. Use sessions actively over 1-2 days (with compaction, tool use, etc.)
  4. Observe RSS growing unbounded — oldest sessions reach 4GB+
  5. Eventually swap fills and system becomes unresponsive

What Should Happen?

Memory usage per session should stabilize at a reasonable level (ideally <500MB) and not grow unbounded over time. Old context should be freed after compaction.

Related Issues

  • #21403 — Memory leak causing OOM kill on Linux (15-17GB)
  • #25023 — Huge memory leak
  • #17615 — Claude process using 304GB+ memory
  • #22162 — API clients created repeatedly instead of reused

This report provides additional data point on Ubuntu 25.10 with kernel 6.17, showing gradual per-session memory growth correlated with session age, rather than a single massive spike.

Claude Model

Opus

Is this a regression?

I don't know

Platform

Anthropic API

Operating System

Ubuntu 25.10

Terminal/Shell

Bash

View original on GitHub ↗

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