23

Rust analyzer and compilation are very slow. My system is heating up, running out of ram and disk space. I have 8 GB ram.

I use helix editor.

you are viewing a single comment's thread
view the rest of the comments
[-] Supercrunchy@programming.dev 9 points 20 hours ago

8GB is not a lot to work with. It mostly depends on what crates you work with (unfortunately by default rust statically links all code in a single final step and that can be consuming a lot of RAM) Modern editors consume a lot of RAM, and if you have rust-analyzer running it's going to use a lot more in addition to the editor.

Tips:

  • trim down yout dependencies (check out cargo tree, cargo depgraph and the cargo build --timings ). Instead of enabling all features on crates, enable only what you need.
  • to free up disk space run cargo clean on the projects you are not currently working on, and regularly on your current project. If you change dependencies often it's going to use up a lot of GBs of disk space. You'll need to recompile all the dependencies every time you run it though, so don't do it too often.
  • fully close other programs if possible (browsers, chat apps, etc). Look at your task manager to see what's using up memory and kill as much as possible. Consider browsing from your phone instead, and using the PC browser just as needed.
  • emacs and vim have a very steep learning curve. I would suggest against that. If it's still too frustrating to code like this, you can disable the language server (rust-analyzer), but it's going to make coding harder. You'll loose edit suggestions and error highlighting. It's still possible to code without rust-analyzer but you'll need to run cargo check very often and read up method names on docs.rs a lot more.
[-] BB_C@programming.dev 1 points 15 hours ago

trimming down your dependencies

is considered harmful.

^I^ ^don't^ ^know^ ^if^ ^someone^ ^wrote^ ^that^ ^blogpost^ ^for^ ^me^

this post was submitted on 06 Mar 2026
23 points (100.0% liked)

Rust

7832 readers
60 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS