Skip to content

Memory leak: RSS grows without bound and is not released after indexing (still present on latest release) #2004

Description

@proudCrisa

Version

Latest published GitHub release (v0.10.8). This report does not include a host-specific --version dump.

Platform

Omitted on purpose. The phenomenon is about process RSS growth of the long-lived MCP server / daemon / index worker, not a single-OS UI glitch.

Install channel

Omitted on purpose.

Binary variant

Omitted on purpose.

What happened, and what did you expect?

Actual

The long-lived codebase-memory-mcp process keeps growing resident memory during indexing and while the MCP server stays up. After an index pass finishes, RSS does not fall back to a small idle baseline. Growth is far larger than the on-disk graph, continues over time, and is severe enough to starve the rest of the machine and make the MCP unusable.

The logged memory budget (budget_mb / memory_budget_bytes) does not stop the growth. It appears to be accounting only: RSS can overshoot it by a large factor, and unused arenas/heap are not returned to the OS.

Expected

  • After indexing completes, unused memory is released to the OS.
  • The published memory budget actually caps growth (or the run fails with a clear overshoot error) instead of only being printed in logs.
  • A long-lived MCP daemon should stay near a stable idle RSS between index passes, not climb until the host is unusable.

Reproduction

This is a long-running resource leak, not a single-file parse failure. No private code, paths, or host details are attached.

  1. Run codebase-memory-mcp as an MCP server against a real workspace (background auto-index / watcher is enough to trigger).
  2. Let indexing or a later reindex run.
  3. Watch process RSS: it climbs far beyond indexed graph size and the logged budget.
  4. After the pass, RSS stays high instead of returning to a small idle baseline.
  5. Further use / reindex makes it worse until the host is unusable.

Logs

Omitted on purpose (no host-specific logs).

Diagnostics trajectory (memory / performance / leak issues)

Omitted on purpose (no host-specific trajectory).

Project scale (if relevant)

Omitted on purpose. The leak is not explained by graph size: RSS is large relative to the indexed data and does not come down after the pass.

Confirmations

Related status (public, already on GitHub)

Please treat this as another confirmation that unbounded RSS growth remains a daily-use blocker on the latest release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existspriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memoryux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions