Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Memory leak & poor performance when using Rust Language Server on Linux #7

Closed
alexheretic opened this issue May 31, 2019 · 0 comments · Fixed by #8
Closed

Memory leak & poor performance when using Rust Language Server on Linux #7

alexheretic opened this issue May 31, 2019 · 0 comments · Fixed by #8

Comments

@alexheretic
Copy link

I've traced a atom memory & performance issue when using RLS (Rust Language Server) to this project.

When watching a rust project directory with nsfw and running RLS, nsfw will leak memory and consume cpu.

Downstream: rust-lang/atom-ide-rust#104

Steps to reproduce

  • Install node & rustup latest stable (see https://rustup.rs)
  • Install rls rustup component add rls
  • Checkout a rust project that isn't tiny, say regex d4b9419
git clone https://github.com/rust-lang/regex
cd regex
git checkout d4b9419
  • Construct a minimal node project with nsfw in another directory
{
  "name": "ntmp",
  "version": "1.0.0",
  "dependencies": {
    "@atom/nsfw": "1.0.23"
  }
}
  • Watch the rust project
node                                                                                                                              
> require('@atom/nsfw')('/home/alex/project/regex', events => {}).then(w => w.start())
  • Run RLS in the rust project
cd regex
rls --cli
  • Restart RLS & re-run to see further leakage.

With these steps it's easy enough to see nsfw consume several GB of ram & lots of CPU as RLS is running. This memory usage/leakage is worse on larger rust projects.

RLS uses cargo/rustc to compile code and generates lots of data in the ./target directory in the project which is what triggers this issue. Strangely though running cargo directly doesn't cause this memory issue. I not sure why this is RLS specific.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants