SonarLint - Problems syncing project with SonarQube server

Please provide

  • Operating system: Windows 11 23H2
  • SonarLint plugin version: 10.8.1.79205 (IntelliJ) / v4.8.0 (VisualStudio Code)
  • IntelliJ version: 2024.1.4
  • Programming language you’re coding in: Java, JSP, JavaScript, TypeScript
  • Is connected mode used: Yes
  • Connected to SonarCloud or SonarQube (and which version): SonarQube Enterprise Edition v10.6

And a thorough description of the problem / question:

We are experiencing issues using SonarLint in connected mode in IntelliJ and VisualStudio Code. The issue appears in IntelliJ 99 % of the time but only sometimes in VisualStudio Code. I havent yet been able to succesfully reproduce a successfull sync in IntelliJ. It randomly works but that only lasts until IntelliJ is restarted.


When using IntelliJ, SonarLint tries to sync the project but the output stops after the message
DEBUG sonarlint - Merged X taint issues in store. Closed 0. | took Xms.

Eventually it runs out of memory and we get the error message
ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-3" java.lang.OutOfMemoryError: Java heap space.

This happens even if we increase the maximum Java heap size to 20 GB. The memory is never returned and the computer is barely usable anymore until IntelliJ is closed. When we configure it to less, for example 4 GB, the error is the same, it just errors out faster.

Excerpt of the SonarLint output in IntelliJ:

[2024-08-07T16:15:19.449] [SonarLint Local Storage Synchronizer] DEBUG sonarlint - GET 200 https://[REDACTED]/api/issues/pull?projectKey=[REDACTED]&branchName=[REDACTED]&languages=css,web,java,js,kotlin,php,plsql,py,ruby,scala,secrets,swift,ts,xml,yaml,cloudformation,docker,kubernetes,terraform | response time=[REDACTED]
[2024-08-07T16:15:20.049] [SonarLint Local Storage Synchronizer] DEBUG sonarlint - Pulled issues in [REDACTED]
[2024-08-07T16:16:02.989] [SonarLint Server RPC request executor] DEBUG sonarlint - GET 200 https://[REDACTED]/api/issues/pull_taint?projectKey=[REDACTED]&branchName=[REDACTED]&languages=css,web,java,js,kotlin,php,plsql,py,ruby,scala,secrets,swift,ts,xml,yaml,cloudformation,docker,kubernetes,terraform | response time=[REDACTED]
[2024-08-07T16:16:04.824] [SonarLint Server RPC request executor] DEBUG sonarlint - Pulled taint issues in [REDACTED]
[2024-08-07T16:16:28.452] [SonarLint Local Storage Synchronizer] DEBUG sonarlint - Merged [REDACTED] issues in store. Closed 0. | took [REDACTED]
[2024-08-07T16:16:28.459] [SonarLint Local Storage Synchronizer] INFO sonarlint - [SYNC] Synchronizing taint issues for project '[REDACTED]' on branch '[REDACTED]'
[2024-08-07T16:16:37.119] [SonarLint Server RPC request executor] DEBUG sonarlint - Merged [REDACTED] taint issues in store. Closed 0. | took [REDACTED]
[2024-08-07T16:18:51.6382881] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-3" java.lang.OutOfMemoryError: Java heap space


When using VisualStudio Code, SonarLint syncs the project successfully with the SonarQube server. After the sync we can see the issues from the server in the Problems tab and in the corresponding files.

The initial sync takes some time, but afterwards the syncs are quite fast as the local cache of the server issues is restored. Sometimes it also hangs after Merged X taint issues in store. Closed 0. | took Xms but the memory never increases as much as with IntelliJ and the computer as well as VS Code stays responsive.

Excerpt of a successfull sync in VS Code with an empty ~/.sonarlint folder:

[Debug - 14:13:10.950] Merged [REDACTED] issues in store. Closed 0. | took [REDACTED]
[Info - 14:13:10.950] [SYNC] Synchronizing taint issues for project '[REDACTED]' on branch '[REDACTED]'
[Debug - 14:14:02.992] GET 200 https://[REDACTED]/api/issues/pull_taint?projectKey=[REDACTED]&branchName=[REDACTED]&languages=apex,c,cpp,cs,css,cobol,web,java,js,php,plsql,py,secrets,tsql,ts,xml,yaml,json,go,cloudformation,docker,kubernetes,terraform,azureresourcemanager | response time=[REDACTED]
[Debug - 14:14:03.960] Pulled taint issues in [REDACTED]
[Debug - 14:14:13.030] Merged [REDACTED] taint issues in store. Closed 0. | took 6258ms
[Info - 14:14:40.526] [SYNC] Synchronizing hotspots for project '[REDACTED]' on branch '[REDACTED]'
[Debug - 14:14:47.130] GET 200 https://[REDACTED]/api/hotspots/pull?projectKey=[REDACTED]&branchName=[REDACTED]&languages=apex,c,cpp,cs,css,cobol,web,java,js,php,plsql,py,secrets,tsql,ts,xml,yaml,json,go,cloudformation,docker,kubernetes,terraform,azureresourcemanager | response time=[REDACTED]
[Debug - 14:14:47.141] Pulled issues in [REDACTED]
[Debug - 14:14:48.746] Merged [REDACTED] hotspots in store. Closed 0. | took [REDACTED]
[Debug - 14:14:48.754] isReadyForAnalysis(connectionId: [REDACTED], sonarProjectKey: [REDACTED], plugins: true, analyzer config: true, findings: true) => true
[Debug - 14:14:48.754] Analysis readiness changed for config scope `file:///d:/[REDACTED]-vscode` to true
[Info - 14:14:48.757] [SYNC] Synchronizing taint issues for project '[REDACTED]' on branch '[REDACTED]'
[Debug - 14:14:49.005] GET 200 https://[REDACTED]/api/issues/pull_taint?projectKey=[REDACTED]&branchName=[REDACTED]&languages=apex,c,cpp,cs,css,cobol,web,java,js,php,plsql,py,secrets,tsql,ts,xml,yaml,json,go,cloudformation,docker,kubernetes,terraform,azureresourcemanager&changedSince=1723205590579 | response time=[REDACTED]
[Debug - 14:14:49.005] Pulled taint issues in [REDACTED]
[Debug - 14:14:52.356] Merged 0 taint issues in store. Closed 0. | took 0ms

I can send the full logs and a thread dump of IntelliJ via PM.

I just retried it with -Xmx12g and got the following error message:

 [2024-08-09T14:41:03.014] [SonarLint Server RPC request executor] DEBUG sonarlint - Merged [REDACTED] taint issues in store. Closed 0. | took [REDACTED]
 [2024-08-09T14:43:27.892919] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-5" java.lang.OutOfMemoryError: Java heap space
 [2024-08-09T14:46:39.8531411] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.OutOfMemoryError: Java heap space
 [2024-08-09T14:46:39.8531411] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-7" java.lang.OutOfMemoryError: Java heap space
 [2024-08-09T14:46:39.8531411] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-4" java.lang.OutOfMemoryError: Java heap space
 [2024-08-09T14:46:39.8531411] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-2" java.lang.OutOfMemoryError: Java heap space
 [2024-08-09T14:46:39.8531411] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-1" java.lang.OutOfMemoryError: Java heap space
 [2024-08-09T14:46:39.8531411] [Thread-74] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "HttpClient-1-SelectorManager" java.lang.OutOfMemoryError: Java heap space

After the error messages the computer became usable again, but IntelliJ is still occupying 12 GB of memory.

I am currently experiencing the same behavior in VS Code, but only in WSL. The debug output stops after [Debug - 08:11:37.372] Merged X taint issues in store. Closed 0. | took Xms

Hello @leo.d, thanks for notifying us about this issue.

I’d appreciate it if you could privately share the logs and thread dumps. I have set this custom link for you to upload the files if you cannot do it via our Community forum.

Could you also share more information about your SonarQube, such as the number of projects it is trying to synchronize against or whether the projects contain many issues?

In the meantime, we are going to investigate the case.

Hi Nicolas,

I sent the logs & thread dump via the link.

The SonarQube instance currently hosts 50 projects. In this case SonarLint is only trying to sync against a single project with ~ 150.000 issues.

Hi @nicolas.quinquenel, sorry to @ you. Has there been any progress regarding the issue in the last month?

Hey @leo.d, I apologize for the delay in responding. This issue was assigned to a specific team and has yet to be handled as other priorities have appeared. I will make sure that they get back to you relatively quickly.

I started investigating your issue, and for now, we don’t have any easy fix available immediately.

Nonetheless, we recently released SonarLint for IntelliJ version 10.10 with some improvements regarding memory management. Given the nature of your issue, I don’t expect it to be solved, but it would be worth trying.

Regarding the heap size, we run a custom SonarLint JVM process under the name SonarLintServerCli. Could you try to increase the heap size by setting this environment variable before starting your IDE:

SONARLINT_JVM_OPTS=-Xmx16g (or any other value you think is valuable)

While waiting for your reply, we are still investigating possible solutions.

1 Like

Hi @nicolas.quinquenel,
thanks for your update. I tried it again with the newer version (IntelliJ: 10.11.1.79663, VS Code: v4.11.1, SonarQube 10.7).
It works pretty reliable in Visual Studio Code now, even without setting the env variable you suggested.
Unfortunately in IntelliJ, it does not work, regardless of the env variable setting. But I do get the following log output in IntelliJ now:

[2024-10-23T11:35:46.286] [SonarLint Local Storage Synchronizer] DEBUG sonarlint - Merged X taint issues in store. Closed 0. | took Xms
[2024-10-23T11:36:03.7132023] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155018
[2024-10-23T11:36:20.4602964] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155003
[2024-10-23T11:36:45.8524986] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155027
[2024-10-23T11:37:10.692342] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155021
[2024-10-23T11:37:38.5609369] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155027
[2024-10-23T11:38:12.9129428] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155033
[2024-10-23T11:38:50.0261172] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155027
[2024-10-23T11:39:47.6314875] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.NegativeArraySizeException: -1526155021
[2024-10-23T11:55:32.8063889] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: Exception in thread "httpclient-dispatch-4" Exception in thread "httpclient-dispatch-8" java.lang.OutOfMemoryError: Java heap space
[2024-10-23T11:55:32.8063889] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at java.base/java.util.Collections$UnmodifiableCollection.iterator(Collections.java:1074)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:167)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:130)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:86)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at java.base/java.lang.Thread.runWith(Thread.java:1596)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at java.base/java.lang.Thread.run(Thread.java:1583)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: java.lang.OutOfMemoryError: Java heap space
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at java.base/java.util.Collections$UnmodifiableCollection.iterator(Collections.java:1074)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:167)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:130)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:86)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at java.base/java.lang.Thread.runWith(Thread.java:1596)
[2024-10-23T11:55:32.8220488] [Thread-19] ERROR org.sonarsource.sonarlint.core.rpc.client.SloopLauncher - StdErr: 	at java.base/java.lang.Thread.run(Thread.java:1583)

SonarLint also gives me the java.lang.NegativeArraySizeException error in VS Code, but only once. After that it finishes the sync and shows the issues in the IDE.

1 Like

Hello @leo.d

This is to provide the update that memory overconsumption and OOM errors are the subject of investigations and topic is not forgotten.
I can’t give any time estimations and deadline commitments for now, but work regarding this topic is happening and the goal is to have a smooth sync with server regardless of number of Issues and Taints we have on server.

Best,

1 Like