Skip to content

Unbounded caches in Instance and Provider modules cause memory growth #13788

Closed

Description

@sauerdaniel

Problem

Several places in the codebase use unbounded Map objects for caching:

  • Instance cache in project/instance.ts
  • Provider SDK cache in provider/provider.ts

In long-running processes or when handling many directories/providers, these maps can grow without limit, causing steady memory growth.

Expected behavior

Caches should have a maximum size with LRU eviction so memory remains bounded, with optional cleanup callbacks for evicted entries.

Related

This is distinct from #9143 (LSP diagnostics/files cleanup, already fixed in f936043dd). This issue is about the broader pattern of unbounded Map caches elsewhere in the codebase.

Activity

  1. added
    perfIndicates a performance issue or need for optimization
    on Feb 16, 2026
  2. github-actions commented on Feb 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review #9140 in particular, as it describes the exact same problem with the same proposed solution (LRU cache with eviction). If you have additional context or reproduction steps beyond what's in #9140, please add them as a comment there.

  3. sauerdaniel commented on Feb 16, 2026

    @sauerdaniel
    ContributorAuthor

    Closing as duplicate of #9140 to keep one issue per problem/PR scope. PR #9141 now references #9140 directly.

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

Metadata

Metadata

Assignees

Labels

perfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions