Skip to content

Commit

Permalink
SLI-1611 Tune the Garbage Collector to avoid high memory usage (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
nquinquenel authored Sep 24, 2024
1 parent b450387 commit 1e31670
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
sonarlint-core = "10.5.0.78949"
sonarlint-core = "10.6.0.79030"

sonar-java = "8.1.0.36477"
sonar-javascript = "10.15.0.27423"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ import org.sonarsource.sonarlint.core.rpc.protocol.backend.config.binding.Bindin
import org.sonarsource.sonarlint.core.rpc.protocol.backend.tracking.TaintVulnerabilityDto
import org.sonarsource.sonarlint.core.rpc.protocol.client.binding.AssistBindingParams
import org.sonarsource.sonarlint.core.rpc.protocol.client.binding.AssistBindingResponse
import org.sonarsource.sonarlint.core.rpc.protocol.client.binding.NoBindingSuggestionFoundParams
import org.sonarsource.sonarlint.core.rpc.protocol.client.connection.AssistCreatingConnectionParams
import org.sonarsource.sonarlint.core.rpc.protocol.client.connection.AssistCreatingConnectionResponse
import org.sonarsource.sonarlint.core.rpc.protocol.client.connection.ConnectionSuggestionDto
Expand Down Expand Up @@ -575,10 +576,11 @@ object SonarLintIntelliJClient : SonarLintRpcClientDelegate {
}
}

override fun noBindingSuggestionFound(projectKey: String) {
override fun noBindingSuggestionFound(params: NoBindingSuggestionFoundParams) {
val serverType = if (params.isSonarCloud) "SonarCloud" else "SonarQube"
projectLessNotification(
"No matching open project found",
"IntelliJ cannot match SonarQube project '$projectKey' to any of the currently open projects. Please open your project and try again.",
"IntelliJ cannot match $serverType project '${params.projectKey}' to any of the currently open projects. Please open your project and try again.",
NotificationType.WARNING,
OpenInBrowserAction("Open Troubleshooting Documentation", null, TROUBLESHOOTING_CONNECTED_MODE_SETUP_LINK)
)
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/sonarlint/intellij/core/BackendService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ class BackendService : Disposable {
sloopPath.toFile().walkTopDown().forEach { file ->
getService(GlobalLogOutput::class.java).log(file.absolutePath, ClientLogOutput.Level.INFO)
}
return sloopLauncher.start(sloopPath, Paths.get(jreHomePath))
return sloopLauncher.start(
sloopPath,
Paths.get(jreHomePath),
"-Xms384m -XX:+UseG1GC -XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRatio=10 -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=50 -XX:ParallelGCThreads=2"
)
}

private fun listenForProcessExit(sloopProcess: Sloop) {
Expand Down Expand Up @@ -344,7 +348,8 @@ class BackendService : Disposable {
nonDefaultRpcRulesConfigurationByKey,
getGlobalSettings().isFocusOnNewCode,
LanguageSpecificRequirements(nodeJsPath, omnisharpRequirementsDto),
false
false,
null
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class BackendServiceTests : AbstractSonarLintHeavyTests() {
`when`(sloop.rpcServer).thenReturn(backend)
`when`(sloop.onExit()).thenReturn(CompletableFuture.completedFuture(null))
val sloopLauncher = mock(SloopLauncher::class.java)
`when`(sloopLauncher.start(any(), any())).thenReturn(sloop)
`when`(sloopLauncher.start(any(), any(), any())).thenReturn(sloop)
service = BackendService(sloopLauncher)
ApplicationManager.getApplication().replaceService(BackendService::class.java, service, testRootDisposable)
}
Expand Down

0 comments on commit 1e31670

Please sign in to comment.