Per-Worktree Language Servers Strain Memory; A Cargo-Check-Based Alternative Cuts Usage
A developer running one git worktree per AI agent found that each worktree spawned its own rust-analyzer instance, duplicating the same analysis of shared code. Attempts to share one rust-analyzer across worktrees partly worked but suffered slow session setup and high retained memory. After a memory exhaustion incident on a 64 GiB build machine, the developer forked rust-analyzer to share identical crates between copies, which cut overhead substantially. The upstream pull request for that fork was closed by maintainers over policy and process concerns. The developer also built an alternative language server that reads rustc's output from cargo check, reporting lower peak memory and much faster query handling in one single-session benchmark on Bevy.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in