Over 100% cpu usage on any changes

Hello!

I am using v3.4.1 of SonarLint on a M1 2020 MacBook Pro and am experiencing over 100% cpu usage on any changes. It takes roughly 20 seconds for it to update the list of current Problems in vscode. Have you heard of any similar reports on this version?

Hello @anon56468539 and welcome to the community!

Thank you for your report. This is very important feedback, difficult to investigate though.
First of all I can refer to related community thread. 3.4.1 is the new version that contain some fixes for issues discussed in this thread.

If you are ready to help in investigation, I would suggest to check if you have any orphaned processes. Since you are using new v3.4.1 you shouldn’t, but still.
And also thread dump made when you have 100% of CPU usage would be useful.

Hello Cameron,

I don’t see any activity on the threads appearing in this dump. For each thread you can find the cpu time used and you can see that it does not exceed a few milliseconds.

That said, in some cases SonarLint does start processes that are not Java processes. First thing you could check is if you observe the same problem when the extension is disabled/uninstalled. You could also check which OS process is hogging the CPU, maybe with the activity/system monitor.

What language are you trying to analyze when this happens ? Are you using connected mode ? If yes are you using SonarCloud or SonarQube, and if the latter in which version ?

Thanks

Hi Cameron, thanks for those extra details.

I still don’t see anything off on the Java side. We indeed spawn a background node process for TS analysis so it probably comes from there.

Another round of questions:

  • What is the version of node that you are using ?
  • What is the size of the file you are trying to analyze ?
  • Would you be able to share with us a small reproducer project ?
  • Did you activate a non-default rule or change parameters of a default rule ?

It could be that there is a performance problem on a rule. You could also try to strip differents part of the file to check if it’s caused by a specific construct in the code. I will try to reproduce on my side with a M1

Hi Cameron,

Any update on this ?

Hello there,

I am closing this thread since it’s getting old and there hasn’t been any activities for a while now. If the problem reappears, please open a new thread and provide us with a reproducer.

Thank you :slight_smile: