2

Findbugs Plugin have around 449 rules. Applying all those rules into my existing sonarqube quality profile and started sonar scanning which is taking lots of memory to scan the whole project and also it is throwing error after some time.

I am using Sonarqube version: 7.5 and Spotbugs jar version: 3.9.4

Set SONAR_SCANNER_OPTS=-Xmx10G for Temporary Command Prompt session but facing the issue with Java Heap Space (GC overhead limit exceed)

ERROR: Error during SonarQube Scanner execution
ERROR: Can not execute Findbugs
ERROR: Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
ERROR: Caused by: GC overhead limit exceeded
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

I expect sonar scanner to work successfully with some selected Spotbugs(Findbugs) rule like vulnerabilities and Malicious rule but its didn't work for limited rule also.

  • 1
    Did you try to use a minimal set and application first? Still memory problems? Is this also the case when not installing Spotbugs? – Jeroen Heier Aug 22 '19 at 15:27
  • Hey Jeroen, Thank you for your response. After integrating spotbugs, We selected some random java files from the project and ran the scan. The scan was successful if we included around 1400 files but if the number is higher that scan was failing due to memory issues. **We tried to run the scan without installing spotbugs and the application was running just fine.** – jayveersolanki Aug 26 '19 at 12:47
  • The [jar release](https://github.com/spotbugs/sonar-findbugs/releases) contains spotbugs 3.1.12. The documentation can be found [here](https://spotbugs.readthedocs.io/en/stable/introduction.html). In the requirements section you can read: "You should have at least 512 MB of memory to use SpotBugs. To analyze very large projects, more memory may be needed." and also: "Support for Java 11 and newer is still experimental". Looking at your last comment this is issue is probably a SpotBug and not SonarQube related issue. – Jeroen Heier Aug 26 '19 at 15:02

1 Answers1

0

This seems like a memory resource starvation issue. According to: Oracle's Troubleshooting Guide on Memory Leaks, this message is the result of the garbage collector running low on heap memory which causes this exception to be thrown. The link indicates that you can turn this exception off with the '-XX:-UseGCOverheadLimit' switch (and the process will continue to execute with a potential performance penalty).

Also, the type of garbage collection may be an issue. Try changing the garbage collector policy with '-XX:+UseConcMarkSweepGC' or '-XX:+UseParallelGC' and running it again.

Slartibartfast
  • 1,605
  • 2
  • 16
  • 23