GC overhead limit exceeded during "Java Main Files AST scan"

511 views
Skip to first unread message

Gonzalo Vasquez

unread,
Dec 19, 2017, 9:54:34 AM12/19/17
to SonarQube
When running Sonarqube analysis from Jenkins using Maven, it always fails on a single project in the "Java Main Files AST scan" analysis, specifically with a "GC overhead limit exceeded" message. I've already tried increasing memory through:

JENKINS_JAVA_OPTIONS="-Xmx2048m -XX:MaxPermSize=512m -Djava.awt.headless=true"

Stack trace

java.lang.OutOfMemoryError: GC overhead limit exceeded
    at org.sonar.java.se.FlowComputation$ExecutionPath$$Lambda$419/1197326589.get$Lambda (Unknown Source)
    at java.lang.invoke.LambdaForm$DMH/1211586911.invokeStatic_L_L (LambdaForm$DMH)
    at java.lang.invoke.LambdaForm$MH/1951500432.linkToTargetMethod (LambdaForm$MH)
    at org.sonar.java.se.FlowComputation$ExecutionPath.learnedAssociation (FlowComputation.java:426)
    at org.sonar.java.se.FlowComputation$ExecutionPath.addEdge (FlowComputation.java:297)
    at org.sonar.java.se.FlowComputation$$Lambda$444/1961786268.apply (Unknown Source)
    at java.util.stream.ReferencePipeline$7$1.accept (ReferencePipeline.java:267)
    at java.util.stream.ReferencePipeline$2$1.accept (ReferencePipeline.java:175)
    at java.util.HashMap$ValueSpliterator.forEachRemaining (HashMap.java:1625)
    at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential (ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential (ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach (ReferencePipeline.java:418)
    at org.sonar.java.se.FlowComputation.run (FlowComputation.java:176)
    at org.sonar.java.se.FlowComputation.flow (FlowComputation.java:154)
    at org.sonar.java.se.FlowComputation.flow (FlowComputation.java:121)
    at org.sonar.java.se.checks.NullDereferenceCheck.reportIssue (NullDereferenceCheck.java:144)
    at org.sonar.java.se.checks.NullDereferenceCheck.lambda$reportIssues$2 (NullDereferenceCheck.java:224)
    at org.sonar.java.se.checks.NullDereferenceCheck$$Lambda$223/1161740578.accept (Unknown Source)
    at java.lang.Iterable.forEach (Iterable.java:75)
    at org.sonar.java.se.checks.NullDereferenceCheck.reportIssues (NullDereferenceCheck.java:224)
    at org.sonar.java.se.checks.NullDereferenceCheck.interruptedExecution (NullDereferenceCheck.java:219)
    at org.sonar.java.se.CheckerDispatcher.lambda$interruptedExecution$0 (CheckerDispatcher.java:154)
    at org.sonar.java.se.CheckerDispatcher$$Lambda$400/800730184.accept (Unknown Source)
    at java.util.ArrayList.forEach (ArrayList.java:1255)
    at org.sonar.java.se.CheckerDispatcher.interruptedExecution (CheckerDispatcher.java:154)
    at org.sonar.java.se.ExplodedGraphWalker.interrupted (ExplodedGraphWalker.java:286)
    at org.sonar.java.se.ExplodedGraphWalker.throwMaxSteps (ExplodedGraphWalker.java:278)
    at org.sonar.java.se.ExplodedGraphWalker.execute (ExplodedGraphWalker.java:230)
    at org.sonar.java.se.ExplodedGraphWalker.visitMethod (ExplodedGraphWalker.java:203)

Anything else should I provide to help diagnose the root cause of the problem?


Software versions
  • SonarQube Version 6.7 (build 33306)
  • Jenkins ver. 2.96
  • Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
  • OpenJDK Runtime Environment (build 1.8.0_151-b12)

Tibor Blenessy

unread,
Dec 20, 2017, 3:59:07 AM12/20/17
to Gonzalo Vasquez, SonarQube
Hello,

in order to help we will need more information. Can you please provide more logs from you analysis? Does this happen also when to try to run the analysis locally?  Is the last file you can see in the logs as being analyzed always the same?

Regards,
Tibor

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/dfc6c5b6-7e1c-4051-9edc-879391519e3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 

Gonzalo Vasquez

unread,
Dec 20, 2017, 8:27:11 AM12/20/17
to SonarQube
Tibor, from your questions:

Attached are the full logs from the standalone local analysis via Maven CLI and, YES, the last analyzed file is always the same.

command used: 

sudo /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/bin/mvn sonar:sonar -Dsonar.forceAnalysis=true -e -X -Dsonar.host.url=<myHost> -Dsonar.login=<myToken>

sonar.log.gz

Tibor Blenessy

unread,
Dec 20, 2017, 8:58:45 AM12/20/17
to Gonzalo Vasquez, SonarQube
Hello,

thank you for the detailed logs. It seems that SonarJava analyzer is indeed stuck on the file "src/cl/waypoint/reports/GetReportAlertasVelocidadZona.java" . Would it be possible for you to share this file (you can write to me privately if you don't want this file to be publicly available). 

Cheers,
Tibor


For more options, visit https://groups.google.com/d/optout.

Tibor Blenessy

unread,
Dec 21, 2017, 4:05:55 AM12/21/17
to Gonzalo Vasquez, SonarQube
Hello again,

I ran analysis on the file you've send me, and I am able to finish analysis when I assign enough memory to the jvm, although it takes a while and I will look if there is some performance improvement to be made.

I realized that in your first mail you wrote that you tried to set variable JENKINS_JAVA_OPTIONS. I am not sure if these options are passed to the jvm which is used to run maven and analysis itself. Can you verify the memory settings of jvm used to run maven? Usually you will set this options by setting MAVEN_OPTS environment variable. You can try to run analysis with 2GB heap setting, and see if you are able to finish without getting the exception.

Regards

Tibor

Gonzalo Vasquez

unread,
Dec 21, 2017, 12:11:33 PM12/21/17
to Tibor Blenessy, SonarQube
Tibor,

I added 2G of RAM to MAVEN_OPTS, but the build failed too, now the message looks like:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "CLEANUP_MANAGER"
[INFO] 189/326 files analyzed, current file: /var/lib/jenkins/workspace/WaypointReports/src/cl/waypoint/reports/GetReportAlertasVelocidadZona.java
[WARNING] [JOURNAL_FLUSHER] WARNING Journal flush operation took 45,908ms last 8 cycles average is 5,738ms


Same failed file though.

Atentamente / Regards,

Gonzalo Vásquez Sáez
Director I+D / R&D Director
Waypoint Telecomunicaciones S.A.

+56 2 2963 4180
+56 9 9799 3516

Suecia 0155 Of. 1103
Providencia, Santiago, Chile
Mapcode: CHL S0.CW

2017-12-21 6:05 GMT-03:00 Tibor Blenessy <tibor.b...@sonarsource.com>:
Hello again,

I ran analysis on the file you've send me, and I am able to finish analysis when I assign enough memory to the jvm, although it takes a while and I will look if there is some performance improvement to be made.

I realized that in your first mail you wrote that you tried to set variable JENKINS_JAVA_OPTIONS. I am not sure if these options are passed to the jvm which is used to run maven and analysis itself. Can you verify the memory settings of jvm used to run maven? Usually you will set this options by setting MAVEN_OPTS environment variable. You can try to run analysis with 2GB heap setting, and see if you are able to finish without getting the exception.

Regards

Tibor


To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 

Tibor Blenessy

unread,
Jan 8, 2018, 12:26:41 PM1/8/18
to Gonzalo Vasquez, SonarQube
Hello Gonzalo,

I identified the performance issue and created a ticket to fix it SONARJAVA-2611 . 
However I still manage to finish the analysis when I allocate enough memory to the jvm heap. It takes long time, because there is very complex method in the file you provided and algorithm of the analyzer is not very efficient in such conditions.

Best regards

Tibor



On Thu, Dec 21, 2017 at 6:11 PM Gonzalo Vasquez <gvas...@waypoint.cl> wrote:
Tibor,

Tibor


--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 

--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 

Gonzalo Vasquez

unread,
Jan 9, 2018, 4:13:48 PM1/9/18
to Tibor Blenessy, SonarQube
Great to know you've been able to identify the root cause! I'm happy to have provided enough evidence


El lunes, 8 de enero de 2018, Tibor Blenessy <tibor.b...@sonarsource.com> escribió:
Hello Gonzalo,

I identified the performance issue and created a ticket to fix it SONARJAVA-2611 . 
However I still manage to finish the analysis when I allocate enough memory to the jvm heap. It takes long time, because there is very complex method in the file you provided and algorithm of the analyzer is not very efficient in such conditions.

Best regards

Tibor



On Thu, Dec 21, 2017 at 6:11 PM Gonzalo Vasquez <gvas...@waypoint.cl> wrote:
Tibor,

I added 2G of RAM to MAVEN_OPTS, but the build failed too, now the message looks like:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "CLEANUP_MANAGER"
[INFO] 189/326 files analyzed, current file: /var/lib/jenkins/workspace/WaypointReports/src/cl/waypoint/reports/GetReportAlertasVelocidadZona.java
[WARNING] [JOURNAL_FLUSHER] WARNING Journal flush operation took 45,908ms last 8 cycles average is 5,738ms


Same failed file though.

Atentamente / Regards,

Gonzalo Vásquez Sáez
Director I+D / R&D Director
Waypoint Telecomunicaciones S.A.

+56 2 2963 4180
+56 9 9799 3516

Suecia 0155 Of. 1103
Providencia, Santiago, Chile
Mapcode: CHL S0.CW

Tibor


To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 

--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 



--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 



--
Reply all
Reply to author
Forward
0 new messages