1

I am running a Jenkins job which creates findbugs report. It seems Findbugs is memory and time hungry Initially I was facing OutOfMemory error issue and I increased memory by setting MAVEN_OPTS variable i.e.

MAVEN_OPTS=-Xms512m -Xmx1024m -XX:MaxPermSize=512m.

Now I am facing Timeout: sub-process interrupted exception. Any suggestion how to get rid of this?

Note: I am using "mvn clean compile findbugs:findbugs" command and if I run it manually its working(without any timeout exception).

Findbugs version: 2.5.3 Jenkins version: 1.545

Here is the error log:

[INFO] [findbugs:findbugs {execution: default-cli}]
[INFO] Fork Value is false
     [java] JVM args ignored when same JVM is used.

Timeout: sub-process interrupted
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Timeout: killed the sub-process
[INFO] ------------------------------------------------------------------------
[INFO] Trace
: Timeout: killed the sub-process
    at org.apache.tools.ant.taskdefs.Java.run(Java.java:774)
    at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
    at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
    at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
    at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
    at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
    at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
    at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:756)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:730)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
    at org.codehaus.mojo.findbugs.FindBugsMojo.executeFindbugs(FindBugsMojo.groovy:997)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
    at org.codehaus.mojo.findbugs.FindBugsMojo.execute(FindBugsMojo.groovy:786)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at hudson.maven.agent.Main.launch(Main.java:204)
    at hudson.maven.MavenBuilder.call(MavenBuilder.java:154)
    at hudson.maven.Maven2Builder.call(Maven2Builder.java:79)
    at hudson.maven.Maven2Builder.call(Maven2Builder.java:55)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:328)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 minutes 16 seconds
[INFO] Finished at: Mon Mar 24 04:13:52 PDT 2014

[INFO] Final Memory: 355M/910M
Mahesh Mehta
  • 13
  • 1
  • 3
  • Maybe [this answer](http://stackoverflow.com/a/12975147/1005481) to *sonar findbugs heap size* can help? – barfuin Mar 24 '14 at 14:29

1 Answers1

2

You may want to check the timeout property of the Maven Findbugs plugin. It is set to 10 minutes by default. Since your analysis is taking 11 minutes 16 seconds, this may be the cause of your problems. Note that you must also set fork to true for this to work.

barfuin
  • 16,865
  • 10
  • 85
  • 132
  • Hi Thomas, Thanks for suggestion. I changed fork value to true and now i am facing OutOfMemory exception. even if I am setting MAVEN_OPTS=-Xms1024m -Xmx2048m -XX:MaxPermSize=1024m for this jenkins job. [INFO] [findbugs:findbugs {execution: default-cli}] [INFO] Fork Value is true [java] Out of memory [java] Total memory: 477M [java] free memory: 60M [INFO] Total time: 9 minutes 58 seconds [INFO] Finished at: Thu Mar 27 04:11:34 PDT 2014 [INFO] Final Memory: 48M/1232M [INFO] channel stopped Finished: FAILURE Any Suggestion? Thanks And Regards Mahesh Mehta – Mahesh Mehta Mar 27 '14 at 11:30
  • The memory settings for the forked VM are set through the [jvmArgs](http://mojo.codehaus.org/findbugs-maven-plugin/findbugs-mojo.html#jvmArgs) parameter. Else your settings will not affect the forked VM. – barfuin Mar 27 '14 at 12:55