I know this is an old thread, but as you said, I don’t have a memory leak, but rather it is taking a lot of memory. Opening 3 projects, all with sonarlint absolutely destroys my memory, reaches 99% and even though my machine does not crash, it becomes unusable.
Any pointers for this ?
Hey @Siddhant_Ghosh, welcome to the community! And thanks for reporting this.
Note: I moved the discussion to a new thread, since it seems from your screenshot that you are using some flavor of Linux (the original thread was about Windows 10)
How many instances of VSCode do you have open? I see a lot of processes associated to SonarLint, and this should not be the case: as far as I can tell, there should be 2 processes per open instance/window of VSCode, one being the (Java-based) language server, the other one being the (Node-based) eslint-bridge server.
Note that we got reports of lingering processes after VSCode closes, but this is a behavior that is hard to reproduce; if it happens often on your box, then maybe we have a chance to understand what is going on
I am also seeing lots of sonarlint related java processes, currently 26, when I have two instances of vscode running. This is not the first time this has happened so perhaps I can help you track down the problem.
I did some intitial testing and the process count seems to increase (almost) every time I switch project (File → Open recent).
So when I open the first project 1 node and 1 java process are created.
After switching projects for a while (for sake of testing) there are few more java processes around.
The funny thing is that the process count does not increase every time I switch projects.
Hi,
I have the same problem here !
Conf:
Ubuntu 20.04.3 LTS
VSCode v1.64.2
SonarLint extension v3.3.3
Like @Sami_S I am used to actually using the vsCode functions :
- New window
- Open recent…
and having multiple instances openned at the same time, thanks to micro-services design
After a while, I have plenty of java processes currently running (and taking memory) even if no VSCode instances are openned.
I have activated Analyzer Logs and Verbose Logs. I will make a return if I get some info.
What about your investigation about this issue ?
Thanks in advance
Hello Sami, Sylvain,
Each VSCode window will start a new instance of our extension, which in turns starts a new Java process. When a VSCode window is closed, the extension and the Java process should be terminated. It appears there is something holding the Java process and preventing its termination.
Could you take a few of those Java processes and run some checks for us ? You can use jps
to list java processes and jstack pid
to get a dump of thread stacks. It would be very helpful for us to get access to those dumps. I expect that the stacks will mostly be the same for each process.
Thanks
Hi @Damien_Urruty ,
Ok I have a few stacks from java processes still running this morning (each VS Code instances is closed). I keep this processes running if you need more information today.
Maybe some details :
- I’m used to connect/disconnect to/from Entreprise VPN, maybe it is linked with this issue ?
- I replace vs code User settings file when changing connexion mode (with or without VPN)
- I use Ubuntu Hibernation as well, sometimes with VSCode running…
sonarlint-ls-143523.log (19.3 KB)
sonarlint-ls-164714.log (16.2 KB)
sonarlint-ls-189780.log (8.5 KB)
sonarlint-ls-261026.log (14.1 KB)
sonarlint-ls-262108.log (10.3 KB)
Hi @Damien_Urruty ,
Is this enough logs for investigation ?
Did you check it ?
Do you need more info ?
Thanks for your feedback
Hi Sylvain,
Thanks for providing those traces, it is useful.
I have the impression that it might be related to several problems. One of them is very likely Apache HTTP client retaining some resources preventing the proper termination. I need to extract a reliable reproducer to help them debug the issue. It seems there is something else though, I need to take some more time to investigate.
I will keep you updated on this thread
I have a new log file from Extension output (stack trace) and a minimal reproduction scenario for you @Damien_Urruty
- open a java project with VS Code
→ ajava
sonarlint process starts running
→ nonode
process started - Open Debug console for SonarLint extension in VSCode
- wait briefly then… (until “Found 0 issues” info message I think)
- close VS Code,
→ java process not killed
It doesn’t happen if I open a javascript project. (the node process correctly starts and stop)
It doesn’t happen if I close VS Code after the warnings and Error shown in Sonarlint Ouptut and then in following file for you. It correctly kills the java process in this case.
sonarlintBug.log (10.2 KB)
also my pretty standard config in settings.json for sonarlint if it could help :
....
"sonarlint.ls.javaHome": "/usr/lib/jvm/java-11-openjdk-amd64",
"sonarlint.connectedMode.connections.sonarcloud": [
{ "connectionId": "mySonarCloud", "organizationKey": "****", "token": "******" }
],
....
++
Just to confirm we are still working on this issue, and here is the ticket to follow:
https://jira.sonarsource.com/browse/SLVSCODE-261
Hello there,
We just released a new version of SonarLint for VSCode on the Marketplace, that contains a lot of fixes for issues raised on this thread. We would be happy if some of you could install it and give us some feedback.
Thanks again for reporting and helping us improve the product!
Hello,
SonarLint v3.4.0 for VSCode installed
I made some tests, seems ok.
I will make others with a proxy and other network stuff. I will give feedback.
Thanks a lot !