Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLI-1611 Tune the Garbage Collector to avoid high memory usage #1178

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Original file line number Diff line number Diff line change
@@ -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
@@ -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)
)
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
@@ -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) {
@@ -344,7 +348,8 @@ class BackendService : Disposable {
nonDefaultRpcRulesConfigurationByKey,
getGlobalSettings().isFocusOnNewCode,
LanguageSpecificRequirements(nodeJsPath, omnisharpRequirementsDto),
false
false,
null
)
)
}
Original file line number Diff line number Diff line change
@@ -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)
}