Hi,
I am using jenkins plugin i.e SonarQube Scanner Version: 2.15
I have 3 projects to scan e.g xyz_server, xyz_client and xyz_plugins.
I have 3 stages in my jenkins pipeline for sonar scan of above projects.
out of 3 projects for xyz_server and xyz_plugins, every time when I run scan analysis it gets completed without any issue. but for xyz_client project I’m getting java.lang.OutOfMemoryError: Java heap space issue every time.
I’m using jenkins slave node to run pipeline.
console output shows Analysis successful for xyz_client but throws above error.
analysis gets updated on sonar server UI correctly for xyz_client but only issue is pipeline fails with java.lang.OutOfMemoryError issue.
when I compared xyz_client vs xyz_server heap memory usage while running sonar scan stage,
it is 4.5gb for xyz_client and 0.5gb for xyz_server.
below is the console output :
java.lang.OutOfMemoryError: Java heap space
at java.base/java.lang.StringLatin1.toChars(Unknown Source)
at java.base/java.lang.String.toCharArray(Unknown Source)
at java.base/sun.nio.fs.UnixPath.encode(Unknown Source)
at java.base/sun.nio.fs.UnixPath.<init>(Unknown Source)
at java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source)
at java.base/java.nio.file.Path.of(Unknown Source)
at java.base/java.nio.file.Paths.get(Unknown Source)
at org.apache.tools.ant.DirectoryScanner.causesIllegalSymlinkLoop(DirectoryScanner.java:1806)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1250)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1194)
at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1156)
at org.apache.tools.ant.DirectoryScanner.checkIncludePatterns(DirectoryScanner.java:954)
at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:912)
at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:528)
at hudson.FilePath.glob(FilePath.java:2167)
at hudson.FilePath$ListGlob.invoke(FilePath.java:2143)
at hudson.FilePath$ListGlob.invoke(FilePath.java:2128)
Also:
org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 71601352-1b84-40fb-8045-12e9f5ff12ca
Caused: java.io.IOException: Remote call on JNLP4-connect connection from my_hostname.my_org.net/my_ip:port failed
at hudson.remoting.Channel.call(Channel.java:1004)
at hudson.FilePath.act(FilePath.java:1186)
at hudson.FilePath.act(FilePath.java:1175)
at hudson.FilePath.list(FilePath.java:2125)
at hudson.FilePath.list(FilePath.java:2108)
at hudson.FilePath.list(FilePath.java:2092)
at hudson.plugins.sonar.utils.SonarUtils.extractReportTask(SonarUtils.java:91)
at hudson.plugins.sonar.utils.SonarUtils.addBuildInfoTo(SonarUtils.java:131)
at hudson.plugins.sonar.SonarBuildWrapper$AddBuildInfo.tearDown(SonarBuildWrapper.java:215)
at org.jenkinsci.plugins.workflow.steps.CoreWrapperStep$Callback.finished(CoreWrapperStep.java:207)
at org.jenkinsci.plugins.workflow.steps.CoreWrapperStep$Execution2$Callback2.finished(CoreWrapperStep.java:150)
at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution$TailCall.lambda$onSuccess$0(GeneralNonBlockingStepExecution.java:140)
at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
following ss shows the original heap size of slave node:
following ss shows memory usage of xyz_client sonar scan process
please help me to resolve this issue