-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak & poor performance when using Rust Language Server on Linux #72
Comments
Thanks for reporting this. I will take a look at this when I get availability for this project next. |
I used @alexheretic 's way and valgrind to find memory leak, I found some interesting outputs:
And the codes in I wrote some code to verify if this would cause leaks #include <iostream>
#include <string>
#include <string.h>
using namespace std;
const char *test_string = "This is a string just for testing.";
void printString(string s)
{
cout << s << endl;
}
int main()
{
// Cause memory leaks!!!
//printString(strdup(test_string));
// No memory leaks occurred
printString(test_string);
return 0;
} And the result is YES! Since |
Nice one @Leo1003 I can no longer reproduce the leaked memory usage. |
I've traced a atom memory & performance issue when using RLS (Rust Language Server) to Atom's version of this project.
When watching a rust project directory with nsfw and running RLS, nsfw will leak memory and consume cpu.
Downstream: atom#7, rust-lang/atom-ide-rust#104
Steps to reproduce
rustup component add rls
d4b9419
git clone https://github.com/rust-lang/regex cd regex git checkout d4b9419
cd regex rls --cli
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.
The text was updated successfully, but these errors were encountered: