Memory leak: Claude Code process consumes ~58GB RAM, triggers OOM killer

Resolved 💬 3 comments Opened Feb 23, 2026 by btk-da Closed Feb 27, 2026

Description

The Claude Code extension (running inside VS Code) gradually consumes memory until it exhausts all available system RAM, triggering the Linux OOM killer. This causes VS Code to crash with the error: "The window terminated unexpectedly (reason: 'clean-exit', code: '0')".

This happened 3 times today within ~2 hours.

OOM killer kernel logs

All three events show the claude process being killed after consuming ~58-60 GB of RAM:

feb 23 17:25:35 kernel: Out of memory: Killed process 51510 (claude) total-vm:150612944kB, anon-rss:61189060kB, file-rss:2684kB, shmem-rss:0kB, UID:1000 pgtables:132720kB oom_score_adj:100

feb 23 18:20:44 kernel: Out of memory: Killed process 127174 (claude) total-vm:148493728kB, anon-rss:60716700kB, file-rss:728kB, shmem-rss:0kB, UID:1000 pgtables:132776kB oom_score_adj:100

feb 23 18:35:59 kernel: Out of memory: Killed process 144492 (claude) total-vm:148101316kB, anon-rss:61407612kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:131772kB oom_score_adj:100

When the claude process is killed, it cascades and takes down VS Code:

[error] ptyHost terminated unexpectedly with code 15
[error] [UtilityProcess type: shared-process]: crashed with code 15 and reason 'killed'
[error] [UtilityProcess id: 1, type: extensionHost]: crashed with code 15 and reason 'killed'
[error] [UtilityProcess id: 1, type: fileWatcher]: crashed with code 15 and reason 'killed'
[error] CodeWindow: renderer process gone (reason: clean-exit, code: <unknown>)

Environment

  • Claude Code VS Code extension: v2.1.49
  • Claude Code CLI: v2.1.50
  • VS Code: 1.109.4 (snap)
  • OS: Ubuntu, kernel 6.17.0-14-generic
  • RAM: 62 GB + 8 GB swap
  • Platform: linux x86_64

Expected behavior

The Claude Code process should not consume unbounded memory. It should stay within reasonable limits or have a configurable memory cap.

Workaround

Periodically restarting the Claude Code session before memory grows too large.

View original on GitHub ↗

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