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

Conversation

nquinquenel
Copy link
Member

@nquinquenel nquinquenel commented Sep 23, 2024

return sloopLauncher.start(
sloopPath,
Paths.get(jreHomePath),
"-Xms512m -XX:+UseG1GC -XX:MaxHeapFreeRatio=50 -XX:MinHeapFreeRatio=20"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we decide on these values?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually did further tuning and found better results with the following:

-Xms384m: SonarLint typically requires at least 200 to 300 MB to start, and grows to 400 or 500 MB during first analysis. Settings this value allows to avoid heap grow cycles at the beginning
-XX:+UseG1GC: This Garbage Collector was found to be the most suitable for our need (low latency & keep memory under control)
-XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRatio=10: This allows to reduce the heap size without degrading the performance too much (it was tested against other values)
-XX:+UseStringDeduplication: As we store a lot of String with the rules that might be duplicated with multiple connections, I think this is worth to use
-XX:MaxGCPauseMillis=50: For performance reasons, default is 200, at 50 it seems to perform well
-XX:ParallelGCThreads=2: Limit the number of threads used during GC, we don't want SonarLint to use all the threads available for performance reasons

@nquinquenel nquinquenel force-pushed the feature/nq/SLI-1611-tune-gc-2 branch from 8e6a578 to c6fcaae Compare September 24, 2024 08:59
@nquinquenel nquinquenel force-pushed the feature/nq/SLI-1611-tune-gc-2 branch from c6fcaae to 6c2b7ab Compare September 24, 2024 09:15
@nquinquenel nquinquenel merged commit 1e31670 into master Sep 24, 2024
31 checks passed
@nquinquenel nquinquenel deleted the feature/nq/SLI-1611-tune-gc-2 branch September 24, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants