-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Out of memory when trying to analyze big auto-generated files #13807
Comments
As mentioned in that thread, I recognize that |
That's odd, I am not running OOM on windows (and I don't see why r-a should OOM on that input), the text and parse queries oly take up ~400mb of memory for me (checked by using the clear database command)
|
@Veykril Ah, forgot to mention that it only happens after you trigger a cargo check. |
Oh, if the generated code generates a ton of warnings I can see this happening, r-a currently creates a lot of allocations quadratic to the amount of check diagnostics iirc |
That's probably the reason why it crashes on the big project. I noticed that the generated code triggered a lot of cc @Manishearth |
..... how? 😄 |
iirc this
Though I don't think we keep those copies in memory all at once so maybe thats not the problem here |
What about the for loop above it? I think we clean it every so often, but we might end up with a lot of them before passing the whole bunch to the client. |
Follow-up of #13788.
Rust analyzer no longer panics when trying to parse big files. However, now my system OOMs (16 GB of RAM) while trying to analyze the generated files.
EDIT:
This only happens after triggering a
cargo check
on save. I testedcargo check
alone and it only consumes 3+GB of RAM, so the problem seems to be R-A.To reproduce
git clone https://github.com/jedel1043/ra-bug.git && cd ra-bug
Depending on the base memory consumption, the used memory should increase by 8+ GB after opening the project and triggering a
cargo check
. For some high-end systems this should not be a problem, but the standalone repo bumps the used memory to approx. 15.8 GB on my system, and trying to use the crate in a mid-sized workspace project directly OOMs.rust-analyzer version: 0.4.1326-standalone
rustc version: rustc 1.66.0 (69f9c33d7 2022-12-12)
cc @Manishearth
The text was updated successfully, but these errors were encountered: