Skip to content

Memory leak #16934

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

Open
pitdicker opened this issue Mar 24, 2024 · 9 comments
Open

Memory leak #16934

pitdicker opened this issue Mar 24, 2024 · 9 comments
Labels
C-bug Category: bug

Comments

@pitdicker
Copy link

On my system rust-analyzer leaks ca. 100mb per second until (hopefully) killed because of OOM. Using rust 1.77.0 on x86_64-unknown-linux-gnu.
Any suggestions on how to diagnose?

rust-analyzer version: rust-analyzer version: 0.3.1885-standalone (b6d1887 2024-03-17)
rustc version: rustc 1.77.0 (aedd173a2 2024-03-17)
repository link: https://github.comchronotope/chrono (not sure if relevant)

@pitdicker pitdicker added the C-bug Category: bug label Mar 24, 2024
@pitdicker
Copy link
Author

I can't reproduce it reliably yet, it has happened ca. 8 times in the last two days.

@Noratrieb
Copy link
Member

probably a duplicate of #16907

@pitdicker
Copy link
Author

That could be it! As always it no longer reproduces after opening an issue, but I'll keep an eye out.

@DrewMcArthur
Copy link

i should have maybe put this comment on one of the open issues, but this happens pretty continuously as a result of trying to format-on-save for me with the destream_json library open.

#16140 (comment)

@markmehere
Copy link

markmehere commented Jul 24, 2024

It's absolutely huge. Hopefully I'll have the time for a closer look at some point but rust-analyzer regularly hits 28-30 gigabytes on my Mac. Wish I had of cracked open a debugger. For future bug reporters:

  1. VSCode -> Command-Shift-P -> Shell Command: Install 'code' command in PATH
  2. code --inspect-extensions=9222
  3. Use remote debugging from your Chrome browser

Seems like you may need to start debugging from before launching VSCode. I've uninstalled rust-analyzer for the moment.

@olekspickle
Copy link

olekspickle commented Jul 25, 2024

I can reliably reproduce it by opening more than 1 project with rust-analyzer hooked

Completely freezes the system for about 10 min resulting in vscode/nvim crash+ sending SIGKILL to terminal instance as well

@Noratrieb
Copy link
Member

this is probably a new issue, the one that this was likely a duplicate of (#16907) was fixed.

@knysfh
Copy link

knysfh commented Nov 30, 2024

When I ran cargo build in the VSCode terminal, the CPU and memory usage rapidly increased. I initially thought the issue was caused by rust-analyzer, but when I disabled all extensions, the problem disappeared.

I eventually determined that it was due to the Markdown All in One extension. If anyone else is experiencing high CPU and memory usage during compilation, it's worth checking whether it's caused by an extension.

@dfberry
Copy link

dfberry commented Mar 6, 2025

Getting this in March 2025 - the fix is definitely to shut all other VSCode windows down. Only 1 instance of VSCode open and the analyzer works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

7 participants