Skip to content

Memory usage quadrupled after salsa migration #19402

@alexkirsz

Description

@alexkirsz

rust-analyzer version: 2025-03-17

rustc version: nightly/2025-01-04

editor or extension: Zed

relevant settings: N/A

After we updated to the latest release of RA, we've seen its memory usage more than quadruple when running on our codebase. Before the update, RA was routinely taking between 5 to 6GB of memory. After the update, it balloons up to 22GB a few seconds after starting, and can increase up to 30GB during use.

I've bisected the regression to 74620e6, which is the port to the new salsa.

I'm currently trying to capture allocations profiles using Instruments on macOS, but the instrumentation makes RA extremely slow, so it takes quite a while to run. I'll try on a subset of our codebase next, which hopefully should reproduce the issue while being faster to run, and update this issue with the results.

Particularities of our setup:

  1. We have about 700 crates, 2800 counting external dependencies.
  2. We use Bazel instead of cargo, which means we use rust-project.json (or more specifically, the ongoing discover config integration).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions