Sonarqube-8.4.2-Developer - higher memory footprint (vs 8.2-Developer)

K8S: 1.18
Sonarqube: 8.4.2-Developer
Sonar/Plugins
[list below reflects same plugins and versions we had when 8.2-Developer was deployed for months]
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Checkstyle / 4.30 /
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Code Smells / 4.0.0
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Findbugs / 4.0.0 /
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Git / 1.11.0.11 / cfaf4e3b9a812716fa699833dc91d5a6cd690f41
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin JaCoCo / 1.0.2.475 / b79a4724f3a9af1051266b4f8ca0460977295ead
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin Java Code Quality and Security / 6.3.0.21585 / ecf8f9f571691771e6789b8e59ff5e6b4ef36ad8
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin PMD / 3.2.1 / 781bc9e240c06c1ae06908a1ab0c0d27e01c2083
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarCSS / 1.2.0.1325 / 8dc9fe17b6230c20715d3b4cb34e0b6d02151afd
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarGo / 1.6.0.719 / edcc6a9e42fcdd30bb6f84a779c6cd7009ec72fd
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 6.2.1.12157 / 3444def97744d3b811822b3a4bca74798de3ded1
2020.09.09 18:40:54 INFO web[o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 2.1.0.4362 / 268ba9581b700c4fb2bc194d4069d283da915213

We had 8.2-Developer for months with Memory[Requests: 1Gi / Limits: 2Gi] and did not experience any problems. Upgraded to 8.4.2-Developer and had to bump it up to [Requests: 3Gi / Limits: 3Gi]. This is way more memory than 8.2-Developer used for months (and no problems)

Considering that nothing changed, besides Sonar version, would like to know if 8.4.2 requires bigger foot print and/or there is bug somewhere ? Has anyone also experienced that? Any tips on how to further troubleshoot / isolate on where/why that much more memory had to be allocated?

help/support appreciated. Thanks

Hello @peppe1977,

The memory required by SonarQube is dependent on the amount of code that you analyze with it, so there is not standard value.
I suppose that you did not change your usage of SonarQube between 8.2 and 8.4.2… and at the same time allocating 2 GB of limit for a Container running a web app like SonarQube is ridiculously low. You were just lucky to run SonarQube with so little before.
If also depends on how much memory you allocate to your SonarQube internal processes (sonar.*.javaOpts properties). By default if I remember well this is 1 GB for the Web process, 2 GB for the CE process and 2 GB for the Search process (ElasticSearch). So if you want to survive with lower memory settings, you’ll have to reduce this … and you’ll have to expect that your platform is not sized to handle a lot of code. You may set:

sonar.web.javaOpts=-Xmx512m -Xms128m
sonar.ce.javaOpts=-Xmx512m -Xms128m
sonar.search.javaOpts=-Xmx768 -Xms768m

Or

docker run -e SONAR_WEB_JAVAOPTS="-Xmx512m -Xms128m" -e SONAR_CE_JAVAOPTS="-Xmx512m -Xms128m" -e SONAR_SEARCH_JAVAOPTS="-Xmx768 -Xms768m" sonarqube:8.4.2-developer

The above may be OK for up to 1M LoC, and would allow to run fine with [Requests: 2Gi / Limits: 3Gi]
You may even allocate less than the above but that would be at your own risks. SonarQube needs a minimum of resources, even when you have not that much code to analyze.

Olivier

Hi Oliver,

Thank you! Appreciated. Indeed, we have not changed the usage of Sonarqube and as 8.2-Developer ran for months without having single compute resources problem then decided to raise the question - why 8.4.2 requires more (i.e. either 8.4.2 has additional features that requires bigger footprint compared to what 8.2 used to have and/or we have a problem to be looked at). Fact is that 8.2 allocation seem plenty whereas 8.4.2 is not and unless that is known (id expect heads up in release notes or somewhere) then there is something off here, right?

Current heap/allocation (default (8.2-Dev and 8.4.2-Dev) - which seems to differ from what you mentioned. can you pls double check what is the official default one? if you confirm to be what you mentioned then wonder why our defaults are lot lower?)

Container ID: docker://2685a993cd3c628d41b658261f9a029c6e73820230080eeeacf28d9a7390c5b6 Image: sonarqube:8.4.2-developer
Image ID: docker-pullable://sonarqube@sha256:655cf10861e40ba369e478b03a1f46d8be6cdad1db7e781a5cf8e699f5df03b5

ES: -Xmx512m -Xms512m
WEB: -Xmx512m -Xms128m
CE: -Xmx512m -Xms128m

Long story short: our problem is not lack of compute resources rather do an upgrade from working 8.2-Dev to 8.4.2-Dev and come across compute resources problems (that’s one of the 3-4 problems we have experienced in 8.4.2). Please advise. thanks /Pedro