0

My first question,sorry for the inconvenience if any. I'm encountered a problem when using Jenkins+SonarQube.I added "Execute SonarQube Scanner" in Jenkins Post Steps, sure about it will work fine becuase other projects go smoothly.But today the process failed for serveral times i check the console output found that analysis stuck on one file wont proceed ,just like :

10:34:05 10:34:05.289 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:34:24 10:34:24.350 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:34:34 10:34:34.352 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:34:53 10:34:53.602 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:35:05 10:35:05.682 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:35:18 10:35:18.668 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:35:32 10:35:32.014 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:35:42 10:35:42.411 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:35:52 10:35:52.794 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:36:06 10:36:06.153 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:36:22 10:36:22.734 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:36:35 10:36:35.653 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:36:46 10:36:46.115 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:36:58 10:36:58.513 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:37:10 10:37:10.391 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:37:20 10:37:20.984 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:37:31 10:37:31.926 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:37:42 10:37:42.755 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:37:53 10:37:53.334 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:38:04 10:38:04.270 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:38:14 10:38:14.781 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:38:29 10:38:29.538 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java
10:38:46 10:38:46.069 INFO: 310/1009 files analyzed, current file: /opt/jenkins-2.107.1-0/apps/jenkins/jenkins_home/workspace/test-svn/XXXX.java    

which result in a "java.lang.OutOfMemoryError: GC overhead limit exceeded" ,sonar analysis will fail , any help?Thanks a lot.
By the way the java file is one of the Apache Cloudstack file named "BaseCmd.java",so the original file should be ok.

BigGinDaHouse
  • 1,282
  • 9
  • 19
Terry Wang
  • 31
  • 3
  • 1
    Did you read [this](https://stackoverflow.com/questions/1393486/error-java-lang-outofmemoryerror-gc-overhead-limit-exceeded) SO question and answers? – Jeroen Heier Apr 18 '18 at 04:00
  • @JeroenHeier thx for the reply , i just read it but still cant get the reason for stucking on the same file , it appears still run analysis on the same file again and again – Terry Wang Apr 18 '18 at 04:56

2 Answers2

0

If you type "SonarQube" in the google search box, then click the VERY FIRST item in the list, then click "need to set up an analysis", then you arrive at this page that has the following at the bottom :

F.A.Q.

Q. Analysis errors out with java.lang.OutOfMemoryError: GC overhead limit exceeded. What do I do?

A. This means that your project is too large or too intricate for the scanner to analyze with the default memory allocation. To fix this you'll want to allocate a larger heap (using -Xmx[numeric value here]) to the process running the analysis. Some CI engines may give you an input to specify the necessary values, for instance if you're using a Maven Build Step in a Jenkins job to run analysis. Otherwise, use Java Options to set a higher value. Note that details of setting Java Options are omitted here because they vary depending on the environment.

Erwin Smout
  • 18,113
  • 4
  • 33
  • 52
  • Thx for your reply . I did increased JVM options : -Xmx1024M -Xms512M -XX:MaxPermSize=256m . My problem is that it appears Sonar-scanner run analysis on the same file again and again , you can see it from the log I posted above. – Terry Wang Apr 18 '18 at 08:55
  • That MAY be a consequence of the error. Note that several comments suggest that this error happens when the running program is no longer making any real progress. If the log entries are created by a separate thread running a TimerTask or so, then that's what you get. – Erwin Smout Apr 18 '18 at 09:17
0

Did not find out the reason why i'm stucked :( . And sure about the file is ok , so I finally add this file into the ignore list. The process goes smoothly.

Terry Wang
  • 31
  • 3