-
Notifications
You must be signed in to change notification settings - Fork 43
Unreasonably poor editor performance when RLS is connected #104
Comments
This strongly seems like an upstream RLS thing, perhaps raise an issue there to get more eyes on this. |
That seems odd - surely a delay on the RLS side, even if that's where the root of the issue is, shouldn't lead to editor delays? I would expect all I/O to be asynchronous, and therefore it should never block waiting for a child process to do something. |
Yes, though heavy usage may still cause such issues. I think the all_targets = false |
@joepie91 I tried to load that profile dump in Atom and got an error message:
Did you record that profile using the Chrome dev tools in Atom? |
Hello, Atom takes all my memory, and makes my computer swap on my SSD ! Without using rust-ide, I don't have any problems. Can you fix this? It's a huge memory leak. Thank you ! |
@crone123 RLS is still suffering memory usage issues in Linux, see rust-lang/rls#1188, rust-lang/rust#56980. I've noticed this seems to cause atom itself to also consume lots of memory (obviously compounding the issue) and currently I have no idea why. |
It's really strange, because the rls process takes about 200MB of memory, but atom....today for me it takes...26GB of memory (14GB on RAM + 12GB on SWAP).... |
Wow that's crazy. How quickly does it get to that after ctrl shift F5 restarting atom? |
Sometimes after 1h, but now just in 5 minutes, I have no choice but I need to disable rust-ide, it's not possible to use it. I saw that, more dependencies the project have, the faster it is to take all the memory. When I work on very small project with only standard lib, I can work some hours without problems (but it's laggy). But, if the project have some dependencies, it's become not usable. And building a project without dependencies not really productive... |
I saw another thing, if I compile from the terminal with cargo, atom become laggy, and generally it make atom to consume more memory than when I use it.... very strange... but it's really a problem... |
I'm having this issue on my laptop and desktop as well. The desktop has 32GB of RAM and it will eat all of it until my computer crashes (No swap) |
Unfortunately the latest 1.35 rls release seems to be even worse for memory usage. |
But it's strange because the rls process takes about 130 - 200MB of RAM, it's really Atom who takes really a lot a memory. Technically, if the problem occurs in RLS, we might see RLS to takes a lot of memory, but it's not the case. Problem in Atom garbage collector? Or in Rust IDE Memory Management? |
Yes I think you're probably right that the Atom memory usage is not connected to the rls memory problems directly. Now I'm getting consistent 8GB atom memory usage I've been experimenting a little. A heap snapshot using the atom dev tools only accounts for ~150MB. I wondered if it's something to do with rustc/rls generating loads of files in the ./target directory. I set my target_dir = "/home/alex/tmp/rls" deleted the old Now atom is down to under 200MB, and this seems to help quite a lot. But I'm not totally sure yet, I'll continue to monitor this. Maybe you could also try this workaround and see if it helps your use case? |
It is possible, because for example, in my case, compiling the project from the terminal will freeze atom. (only with Rust IDE enabled) during the compile time. So, it's possible that is a cause. In my case, for some weeks, the only way I have to work is to disable Rust IDE. |
@alexheretic I'm able to recreate this behavior. Thank for you for finding a work-around! This issue was making atom nearly unusable, requiring frequent restarts. |
Ok, but why there is an issue only when IDE Rust is enabled? If I run "cargo build" Atom will freeze, but only if IDE Rust is enabled, not if it's not the case. |
The memory problem I'm seeing is there when ide-rust is disabled. If I disable ide-rust and restart, then open a terminal and run This does makes sense as, if I'm reading the atom code correctly, the atom file watchers are setup & active at project startup. When enabled ide-rust is running rls, which of course contributes to the issue. You can try the same test and maybe we can rule out ide-rust itself. |
One thing I can't really explain is the memory issue isn't reproducible by running cargo directly, even in a different target dir. I can run cargo builds multiple times without causes atom memory issues. But when I run Quite strange since really rls is basically just running cargo itself. |
But, does rls generate more files than just cargo? It must a difference between the 2 that produce a bug in Atom FS Watcher. I confirm was never produce this issue for me, except maybe when IDE Rust is running, I can see Atom freezing each time I run cargo, but maybe it's related to the fact RLS is running, and Atom takes already a huge amount of memory.... I will try running RLS without rust ide to see if I can see the issue. |
I can confirm that problem is Atom related. Without Rust IDE, if you run Today when I work, atom uses approximately 250MB or RAM, and just a few seconds after starting rls --cli, atom takes 700MB, and grow until rls is closed. |
I've reproduced it using minimal atom/nsfw code & raised atom/nsfw#7 & Axosoft/nsfw#72. As that code is platform specific, this may only be affecting Linux users. |
Just to add a data point, I'm on Linux and I see Atom start to use > 10 GB of memory regularly on relatively small ~1000 LOC projects.
Relatively few dependencies too: [dependencies]
vek = "0.9"
image = "0.21"
tobj = "0.1"
[dev-dependencies]
assert_approx_eq = "1.1"
[profile.dev]
opt-level = 3 I'm going to try removing the |
@sunjay the nsfw Linux leak has been fixed but I'm not sure it's in an atom release yet, did you try the workaround #104 (comment) ? |
I tested it for a few days and the workaround does indeed address the memory leak. Thanks! |
ide-rust has moved to using rust-analyzer instead of RLS. I'll close this issue for now, please reopen if this still applies to the new stack. |
I'm currently following this blog series, and I'm experiencing severe performance issues in Atom while doing so; every file modification (key press, undo, etc.) takes anywhere between 100ms and 500ms to occur, and the editor hangs in the meantime. This is making my editor absolutely unusable.
I've isolated the problem to ide-rust, specifically when it's connected to an RLS instance with an
rls.toml
specifying an alternate target; I've tested the following scenarios:rls.toml
specified: Performance is unusably poor.rls.toml
removed: Performance is fine.I've uploaded an archive here of the project in the exact state in which it causes performance issues. There's also a profiler dump of the performance issues.
I'm currently using Atom 1.31.2 x64, on NixOS 18.03.
(The
rls.toml
is necessary to keep RLS from complaining about conflicts withstd
, since this is ano_std
project.)The text was updated successfully, but these errors were encountered: