Where does rust-analyzer store its project data?

Rust-analyzer generated a few gibibytes of data while analyzing a project I'm working on, and I would like to reclaim this space. Is there somewhere rust-analyzer stores its analysis data, like RLS does in the project's target directory, I could clean out?

rust-analyzer doesn’t store any data on disk, everything is resident in memory all the time.


Hmmm :thinking: Well, free space on my drive started dropping when rust-analyzer began processing the project and stopped when it calmed down.

I noticed rust-analyzer called RLS a number of times while it was working; maybe that has something to do with it? RLS used up about the same amount of space I'm seeing now (which is partially why I'm trying to switch to rust-analyzer).

This seems weird - are you sure you aren't accidentally using both RLS and rust-analyzer concurrently? rust-analyzer itself has no dependency on rls. What editor are you using, and what plugins in it? There could be something else still calling RLS even if you have, for example, the rust-analyzer VS Code plugin.

rust-analyzer can and will call cargo to run cargo check and get errors that way, and that could be consuming some disk space in ./target, but it'll never call RLS.

1 Like

I'm using Vim with ALE. It definitely sounds like the issue could be ALE or my configuration of it. I'll test using a different plugin.

Unfortunately, this doesn't solve my storage issue -- since I haven't found where the offending files are stored yet -- so now I'll try searching for the files myself.

For the storage problem, have you tried using any file usage visualizers to locate things? On linux, Baobab is pretty good, and WinDirStat is an equivalent on windows.

1 Like

Thanks. I'm actually running WinDirStat right now. Very useful program.

1 Like

Rust-analyzer seems to be working perfectly with the new plugin, CoC -- and I think I might like CoC even better than ALE.

I haven't been able to find what clogged up those extra few gibibytes, but did realize RLS had stored build artifacts for every sub-crate. I was able to reclaim 6 gibibytes by cleaning those out.

I'm excited to start using a language server that seems faster, more featureful, and doesn't use disk space! Thanks for your help.

Edit: It looks looks like my debug target artifacts have been rebuilt recently, starting around the time I started using rust-analyzer, so you were right about the extra disk usage just being its calls to cargo check. Thanks again!

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.