# Sonarqube instances consuming too much RAM

**URL:** <https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube\
**Created:** [December 10, 2024, 1:25pm UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932 "2024-12-10T13:25:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamad\_dhaini](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mohamad_dhaini/32/58262_2.png) [@mohamad\_dhaini](https://community.sonarsource.com/u/mohamad_dhaini)\
**Post date:** [December 10, 2024, 1:25pm UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/1 "2024-12-10T13:25:07Z")

</div>

We are experiencing an issue where our SonarQube Community Edition instances are consuming an unexpectedly high amount of RAM. This is impacting the performance of our systems and other applications hosted on the same servers. We would like assistance in identifying and resolving the root cause.

### Details:

- **SonarQube Version:** Community Edition 10.6
- **Operating System:** 22.04.2 LTS
- **RAM Usage Observed:** [“Instance using 56 of 63 GiB”]
- **Hardware Specs:**
  - CPU: 6
  - RAM: 64
  - Disk: 200GB

- **Database in Use:** [PostgreSQL 12]

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 11, 2024, 9:07am UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/2 "2024-12-11T09:07:00Z")

</div>

Hey there.

SonarQube Server spins up 4 processes that are capped in how much memory they can use based on what is configured in your _conf/sonar.properties_ file (the -Xmx value for `sonar.web.javaOpts`, `sonar.search.javaOpts`, and `sonar.ce.javaOpts`).

Unless you’ve set these very high, I would recommend you look at what is actually consuming memory on your server. Are they java processes?

There are many ways you can pull this data. [Here’s one example command](https://superuser.com/a/1037753).

---

<div class="post-metadata">

**Author:** ![mohamad\_dhaini](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mohamad_dhaini/32/58262_2.png) [@mohamad\_dhaini](https://community.sonarsource.com/u/mohamad_dhaini)\
**Post date:** [December 23, 2024, 10:35am UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/3 "2024-12-23T10:35:48Z")

</div>

Hello @Colin,

I set those configs in my sonar.properties as follows:  
sonar.web.javaOpts=-Xmx4096m -Xms128m -XX:+HeapDumpOnOutOfMemoryError

sonar.ce.javaOpts=-Xmx16g -Xms128m -XX:+HeapDumpOnOutOfMemoryError

sonar.search.javaOpts=-Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError

and after launching the command you provided:  
4913.45 MB /opt/java/openjdk/bin/java

Please let me know if these configurations are recommended for my setup, especially considering I am running multiple SonarQube instances on the same node. This issue did not occur before upgrading to version 10.6.

Thanks.  
Mohamad

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [December 23, 2024, 11:02am UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/4 "2024-12-23T11:02:13Z")

</div>

If you’re running multiple SonarQube instances that can consume up 21 GB of memory each (the max values of `-Xmx` for each JVM process)… I’m not surprised you’re facing memory issues.

Typically these values only need to be adjusted from the defaults if you have a high-load SonarQube server, specifically [running multiple CE workers](https://docs.sonarsource.com/sonarqube-server/latest/server-upgrade-and-maintenance/maintenance/improving-performance/) – however, that’s a feature only available in Enterprise Edition and above.

Why did you adjust the memory values in the first place?

---

<div class="post-metadata">

**Author:** ![mohamad\_dhaini](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mohamad_dhaini/32/58262_2.png) [@mohamad\_dhaini](https://community.sonarsource.com/u/mohamad_dhaini)\
**Post date:** [December 23, 2024, 2:30pm UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/5 "2024-12-23T14:30:17Z")

</div>

I do not recall to be honest why we have adjusted them. But as I understand from you we shouldn’t have changed them?

---

<div class="post-metadata">

**Author:** ![mohamad\_dhaini](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mohamad_dhaini/32/58262_2.png) [@mohamad\_dhaini](https://community.sonarsource.com/u/mohamad_dhaini)\
**Post date:** [January 20, 2025, 8:57am UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/6 "2025-01-20T08:57:22Z")

</div>

@Colin any updates?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [January 20, 2025, 1:02pm UTC](https://community.sonarsource.com/t/sonarqube-instances-consuming-too-much-ram/131932/7 "2025-01-20T13:02:11Z")

</div>

Hey there.

Not particularly. You should either reduce the amount of memory allocated to each SonarQube server or stop running multiple SonarQube instances on the same host.
