Skip to content

[Bug] Critical memory leak: arrayBuffers reach 4.2GB in fresh session #33413

@aokitashipro

Description

@aokitashipro

Bug Description
[BUG] Severe memory leak on fresh session: 4.2GB arrayBuffers in 3.5 minutes

Bug Description

Massive memory leak occurs immediately on a fresh session.
arrayBuffers reaches 4.2GB within 3.5 minutes of starting.

Environment

  • Claude Code version: 2.1.72
  • Node: v24.3.0
  • Platform: macOS (darwin)

Heap Dump Data (from /heapdump)

  • uptimeSeconds: 214
  • arrayBuffers: 4,209,657,864 bytes (4.21 GB)
  • external: 4,920,081,767 bytes (4.92 GB)
  • heapUsed: 4,960,605,927 bytes (4.96 GB)
  • memoryGrowthRate: 74,299 MB/hour

Steps to Reproduce

  1. Start a fresh claude session
  2. Run a task with multiple tool uses (~12 tool uses, 42k tokens)
  3. Run /heapdump
  4. Observe 4+ GB arrayBuffers after only 3.5 minutes

Expected Behavior

Memory should remain stable and bounded in a fresh session.

Actual Behavior

arrayBuffers grows to 4.2GB within 3.5 minutes with no signs of GC.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.72
  • Feedback ID: ab48082d-5988-4dac-b112-98101425c018

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.72 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at kEq (/$bunfs/root/src/entrypoints/cli.js:2612:1169)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:42:04.586Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.70 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at Kv7 (/$bunfs/root/src/entrypoints/cli.js:2610:20514)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2612:4618)\n    at async WF_ (/$bunfs/root/src/entrypoints/cli.js:2612:4584)\n    at async T (/$bunfs/root/src/entrypoints/cli.js:13341:4864)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:52:13.477Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.69 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at Kv7 (/$bunfs/root/src/entrypoints/cli.js:2610:20514)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2612:4618)\n    at async WF_ (/$bunfs/root/src/entrypoints/cli.js:2612:4584)\n    at async T (/$bunfs/root/src/entrypoints/cli.js:13341:4864)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:52:13.477Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.62 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at Kv7 (/$bunfs/root/src/entrypoints/cli.js:2610:20514)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2612:4618)\n    at async WF_ (/$bunfs/root/src/entrypoints/cli.js:2612:4584)\n    at async T (/$bunfs/root/src/entrypoints/cli.js:13341:4864)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:52:13.477Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.68 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at Kv7 (/$bunfs/root/src/entrypoints/cli.js:2610:20514)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2612:4618)\n    at async WF_ (/$bunfs/root/src/entrypoints/cli.js:2612:4584)\n    at async T (/$bunfs/root/src/entrypoints/cli.js:13341:4864)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:52:13.477Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.66 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at Kv7 (/$bunfs/root/src/entrypoints/cli.js:2610:20514)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2612:4618)\n    at async WF_ (/$bunfs/root/src/entrypoints/cli.js:2612:4584)\n    at async T (/$bunfs/root/src/entrypoints/cli.js:13341:4864)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:52:13.477Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share/claude/versions/2.1.63 (expected in multi-process scenarios)\n    at byT (/$bunfs/root/src/entrypoints/cli.js:2612:2025)\n    at Kv7 (/$bunfs/root/src/entrypoints/cli.js:2610:20514)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2612:4618)\n    at async WF_ (/$bunfs/root/src/entrypoints/cli.js:2612:4584)\n    at async T (/$bunfs/root/src/entrypoints/cli.js:13341:4864)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-11T23:52:13.477Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/a-aoki/.local/share…

Note: Content was truncated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existshas reproHas detailed reproduction stepsperf:memoryplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions