Heap space error on test report generation


(markus_fried) #1

Hi,

I’m getting a Build failed with a Java Heap Space error in some Xalan classes that point to the test report generation step (all tests ran successfully).

I tried upping the heap space using jvmArgs ‘-Xmx1024m’, ‘-XX:MaxPermSize=256m’ on the test task, but that didn’ work.

This error happens on Jenkins (Linux) only, local builds on Windows7 64 run just fine.

Any ideas?

Best regards Mark

07:43:48.915 [QUIET] [system.out] 07:43:48.913 [DEBUG] [org.gradle.messaging.remote.internal.ReceiveProtocol] All producers finished. Stopping now. 07:43:48.915 [QUIET] [system.out] 07:43:48.913 [DEBUG] [org.gradle.messaging.remote.internal.Router] Received route unavailable. Message: [ConsumerUnavailable id: 38d7ebab-e93c-4c3c-907b-524f0460f9fd] 07:43:48.916 [DEBUG] [org.gradle.messaging.remote.internal.SendProtocol] Consumer stopped: [ConsumerStopped, consumerId: 38d7ebab-e93c-4c3c-907b-524f0460f9fd, producerId: 137069db-817a-4776-bbaf-d2be44b77e17] 07:43:48.916 [QUIET] [system.out] 07:43:48.916 [DEBUG] [org.gradle.messaging.remote.internal.WorkerProtocol] Received worker stopped: [EndOfStreamEvent] 07:43:48.957 [DEBUG] [org.gradle.messaging.remote.internal.Router] Received route unavailable. Message: [ConsumerUnavailable id: 38d7ebab-e93c-4c3c-907b-524f0460f9fd] 07:43:48.958 [DEBUG] [org.gradle.messaging.remote.internal.SendProtocol] Consumer unavailable: [ConsumerUnavailable id: 38d7ebab-e93c-4c3c-907b-524f0460f9fd] 07:43:48.960 [QUIET] [system.out] 07:43:48.959 [DEBUG] [org.gradle.messaging.remote.internal.Router] Removing route 137069db-817a-4776-bbaf-d2be44b77e17 due to end of stream. 07:43:48.960 [QUIET] [system.out] 07:43:48.959 [DEBUG] [org.gradle.messaging.remote.internal.Router] Removing route 1c9664d5-7359-4237-b23c-231fda3aab2c due to end of stream. 07:43:49.048 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process finished (code: 0) for Gradle Worker 1. 07:43:49.049 [DEBUG] [org.gradle.messaging.remote.internal.SendProtocol] All consumers stopped. Stopping now. 07:43:49.049 [DEBUG] [org.gradle.messaging.remote.internal.Router] Received route unavailable. Message: [ProducerUnavailable id: 137069db-817a-4776-bbaf-d2be44b77e17] 07:43:49.050 [DEBUG] [org.gradle.messaging.remote.internal.ReceiveProtocol] No producers. Stopping now. 07:43:49.050 [DEBUG] [org.gradle.messaging.remote.internal.Router] Received route unavailable. Message: [ConsumerUnavailable id: 1c9664d5-7359-4237-b23c-231fda3aab2c] 07:43:49.051 [DEBUG] [org.gradle.messaging.remote.internal.WorkerProtocol] Received worker stopped: [EndOfStreamEvent] 07:43:49.055 [DEBUG] [org.gradle.api.tasks.testing.Test] Finished tests 07:43:51.593 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@535b58, org.gradle.logging.internal.slf4j.Slf4jLoggingConfigurer@922804, org.gradle.logging.internal.JavaUtilLoggingConfigurer@1815859] 07:43:51.593 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ‘:test’ 07:43:51.599 [ERROR] [org.gradle.BuildExceptionReporter]

07:43:51.603 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 07:43:51.603 [ERROR] [org.gradle.BuildExceptionReporter]

07:43:51.603 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 07:43:51.603 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ‘:test’. 07:43:51.606 [ERROR] [org.gradle.BuildExceptionReporter] > Java heap space 07:43:51.606 [ERROR] [org.gradle.BuildExceptionReporter]

07:43:51.606 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 07:43:51.607 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:test’. 07:43:51.607 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68) 07:43:51.607 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 07:43:51.607 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34) 07:43:51.608 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34) 07:43:51.616 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200) 07:43:51.622 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172) 07:43:51.623 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198) 07:43:51.623 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:111) 07:43:51.623 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83) 07:43:51.623 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32) 07:43:51.623 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55) 07:43:51.623 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57) 07:43:51.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41) 07:43:51.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) 07:43:51.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52) 07:43:51.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42) 07:43:51.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247) 07:43:51.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192) 07:43:51.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177) 07:43:51.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83) 07:43:51.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36) 07:43:51.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 07:43:51.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) 07:43:51.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) 07:43:51.626 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31) 07:43:51.626 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111) 07:43:51.626 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126) 07:43:51.626 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109) 07:43:51.626 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:103) 07:43:51.626 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79) 07:43:51.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29) 07:43:51.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 07:43:51.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) 07:43:51.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) 07:43:51.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 07:43:51.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 07:43:51.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) 07:43:51.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155) 07:43:51.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110) 07:43:51.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78) 07:43:51.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42) 07:43:51.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28) 07:43:51.629 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) 07:43:51.629 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) 07:43:51.629 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) 07:43:51.629 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) 07:43:51.629 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:31) 07:43:51.629 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:20) 07:43:51.630 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:48) 07:43:51.630 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:45) 07:43:51.630 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:39) 07:43:51.630 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) 07:43:51.630 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:32) 07:43:51.630 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:24) 07:43:51.631 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.OutOfMemoryError: Java heap space 07:43:51.631 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xml.internal.serializer.ToStream.characters(ToStream.java:1610) 07:43:51.631 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:240) 07:43:51.631 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.631 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.632 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.632 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.632 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.632 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.632 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:226) 07:43:51.632 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:132) 07:43:51.633 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:94) 07:43:51.633 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:663) 07:43:51.633 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:709) 07:43:51.633 [ERROR] [org.gradle.BuildExceptionReporter] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313) 07:43:51.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.reporting.HtmlReportRenderer$1.writeTo(HtmlReportRenderer.java:68) 07:43:51.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.reporting.HtmlReportRenderer$2.writeTo(HtmlReportRenderer.java:77) 07:43:51.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.reporting.TextReportRenderer.writeTo(TextReportRenderer.java:36) 07:43:51.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.reporting.HtmlReportRenderer$2.writeTo(HtmlReportRenderer.java:82) 07:43:51.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport.generatePage(DefaultTestReport.java:129) 07:43:51.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport.generateFiles(DefaultTestReport.java:120) 07:43:51.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport.generateReport(DefaultTestReport.java:53) 07:43:51.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.testing.junit.JUnitTestFramework.report(JUnitTestFramework.java:73) 07:43:51.635 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.testing.Test.executeTests(Test.java:397) 07:43:51.635 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196) 07:43:51.635 [ERROR] [org.gradle.BuildExceptionReporter]

07:43:51.635 [LIFECYCLE] [org.gradle.BuildResultLogger]

07:43:51.636 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED 07:43:51.636 [LIFECYCLE] [org.gradle.BuildResultLogger]

07:43:51.636 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 59.951 secs


(Peter Niederwieser) #2

Test report generation happens in the Gradle JVM, not the test JVM(s). You can increase heap space for the Gradle JVM via ‘GRADLE_OPTS’ or by setting the ‘org.gradle.jvmargs’ property in ‘gradle.properties’.


(markus_fried) #3

perfect - that worked!

Thanks Mark.