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.