IDE name and flavor/env: VSCode Version: 1.65.2 (Universal)
SonarLint plugin version: 3.3.3
Is connected mode used:
Connected to SonarCloud or SonarQube (and which version): Connected to sonarlint.connectedMode.connections.sonarcloud hosted on https://sonarcloud.io/ (not sure where I can get a version on that)
And a thorough description of the problem / question:
My team is having some different issues and we have been unable to diagnose. All of us are using Mac machines (MacBook Pro) and we are seeing issues on both Big Sur as well as Monterey.
The problem I have is orphaned java processes. Example output from “ps”:
In my case, sometime while working (and I do close the lid of my laptop and bring it home at night, so I do run VS code over multiple days), I will check my running java processes and find that I have more sonar java processes than open VS code windows. Only way to fix them is to reboot or just run pkill -9 java to terminate them.
If I just open & close VS code windows, they do seem to close, so it seems like more of an issue with running code over time. For example, I just checked and I had 6 sonar java processes running for just 3 vs code windows. After force quitting (pkill) those processes, 3 restarted (the number expected). So somehow 3 processes were running that should not have been running.
At least 3 of my coworkers have a worse problem in that sometimes their sonar processes spike their CPUs to 100% and severely impact their performance. All 3 have resorted to disabling sonar on their IDEs as they just got frustrated.
I have tried to compare my computer to theirs but have found no discrepancies with settings or environments that would figure out why theirs does this but mine does not.
Sorry to be light in details, but this is definitely affecting our ability to use the extension.
One of my coworkers had his process immediately go to 200% - 300% CPU after re-enabling his extension (he is using a JDK 11 as his java home).
First of all, thanks for taking the time to report the issue(s).
There are two (likely) separate issues:
Orphaned Java processes (sonarlint-ls.jar). We are aware of the issue, and even experiencing it randomly on our side. Here is the ticket I just created to allow you to follow the resolution if you like: [SLVSCODE-261] Orphaned language server processes - SonarSource. This is high priority on our side, and since we can reproduce, we should be able to fix it.
High CPU usage. This one is more tricky for us to investigate without at least a thread dump. That’s where we need your help, especially if you have a setup where you can reproduce consistently. Please see the different methods to collect a thread dump, and when the CPU spikes, trigger a dump and share the output with us.
Update: we recently changed the section of code that seems to be causing this CPU problem, could you give a try with this artifact please ? You can find how to install it here.
Hey,
I have the same issue (both of them, actually) and this new artifacts really does help in my case.
As soon as I switch to latest stable version, issue re-appars. I just have to rapidly switch between files and java process would basically explode. This does not happen with provided version of extension
FYI, I have a workspace with several folders (~10), each having their own SQ config and git repo (with git history ranging from 5 to 70k commits).
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!