-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RA uses 14.7GB RAM on my M3 mac #19552
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
Comments
In terms of what could be immediately be done, disabling cache priming ("indexing") could help, but that largely defers the memory usage growth: if you're to open/visit the files in question, you'll largely end up with similar memory usage. This does mean the initial LSP requests will take longer, but if you have a large Cargo workspace but rarely touch some crates, this might help. Out of curiosity, how many lines of code this is project? We've had reports of rust-analyzer's memory usage increasing dramatically on some projects since #18964 landed, but we haven't really determined why some projects seem to have large memory usage spikes while others simply don't. |
what I meant is what can you do to fix this issue - which is obviously a bug. Cant you use some memory mapped storage and map a smaller amount of it to RAM than 14GB ? something is wrong with how you store those structs in memory. |
Well, yes: the trouble is that it's not clear to us what exactly is wrong. Do you mind cloning and building rust-analyzer from source using |
Just for reference: #19402 |
Hi - running into similar issues on the http://github.com/dioxusLabs/dioxus/ repo. 17gb of memory usage and seems to endlessly climb. This is particularly bad on my machine because I only have 32gb of ram and rust-analyzer and cargo check truly chug (6+ sec per check), assuming it's paging in memory from swap. It got so bad I just bought an M4 with 128gb of ram, coming in tomorrow :-) ![]() Lines:
analysis-stats:
With --run-all-ide-things:
my config: "rust-analyzer.cargo.buildScripts.rebuildOnSave": false,
"rust-analyzer.check.workspace": false,
"rust-analyzer.procMacro.attributes.enable": true,
"rust-analyzer.diagnostics.disabled": [
"macro-error",
"unresolved-proc-macro"
],
"rust-analyzer.completion.privateEditable.enable": false,
"rust-analyzer.inlayHints.renderColons": true,
"rust-analyzer.inlayHints.parameterHints.enable": true,
"rust-analyzer.completion.fullFunctionSignatures.enable": false,
"rust-analyzer.imports.preferPrelude": true,
"rust-analyzer.inlayHints.closureReturnTypeHints.enable": "with_block",
"rust-analyzer.inlayHints.closureStyle": "rust_analyzer",
"rust-analyzer.imports.granularity.enforce": true,
"rust-analyzer.inlayHints.lifetimeElisionHints.enable": "skip_trivial",
"rust-analyzer.inlayHints.typeHints.enable": true,
"rust-analyzer.lens.references.adt.enable": true,
"rust-analyzer.lens.references.method.enable": false,
"rust-analyzer.lens.references.trait.enable": true,
"rust-analyzer.lens.references.enumVariant.enable": false,
"rust-analyzer.restartServerOnConfigChange": true,
"rust-analyzer.cargo.buildScripts.enable": false,
"rust-analyzer.check.allTargets": false,
"rust-analyzer.cachePriming.enable": false,
"rust-analyzer.cargo.extraArgs": [
"--profile",
"ra-fast"
], |
this is still happening. sometimes I end up with 3 rust analyser processes running, each occupying 15GB of RAM. 1 rust analyser process occupies double the RAM rust rover uses for the whole IDE. will have to move back to RustRover. Such a shame. |
You are free to do so, no one is forcing you to use rust-analyzer, just know that comments like these do not help anyone. They do not fix these issues either, in fact they might have the opposite of effect! So you might want to reconsider these kinds of comments in the future. |
rust 1.85
fairly large project
what can be done here ? that is an insane amount of RAM.
The text was updated successfully, but these errors were encountered: