Skip to content

Commit 9e46438

Browse files
committed
README: add a warning about rust-analyzer's memory usage
1 parent 4b2f0fa commit 9e46438

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

README.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ NOTE: This section assumes you're already familiar with the prerequisites and en
8181
* Use `cargo check` when you just want to know if your code compiles. It's _much_ faster than `cargo build` or `cargo nextest run`.
8282
* When using Cargo's check/build/test/clippy commands, you can use the `-p PACKAGE` flag to only operate on a specific package. This often saves a lot of time for incremental builds.
8383
* When using Cargo's check/build/clippy commands, use `--all-targets` to make sure you're checking or building the test code, too.
84+
* Beware of rust-analyzer's memory usage, which can easily be over 12 GB per
85+
process. If you spawn multiple instances of it for this codebase, whether by
86+
using multiple instances of vim, multiple editors, or some combination of
87+
editors and coding agents, it's easy to accidentally overwhelm your system.
88+
Consider using something like https://codeberg.org/p2502/lspmux[lspmux] (or
89+
https://github.com/sunshowers/lspmux-rust-analyzer[sunshowers/lspmux-rust-analyzer])
90+
to prevent this from happening.
8491
* Use https://rust-analyzer.github.io/book/configuration#cargo.targetDir[`cargo.targetDir`] to give rust-analyzer a target directory other than `./target` so it doesn't block you from running commands in the terminal. This uses extra disk space.
8592

8693
These are explained a bit more below, along with some common pitfalls.

0 commit comments

Comments
 (0)