damianszczepanik / cucumber-reporting-jenkins

Java jenkins plugin for cucumber-jvm reporting
151 stars 12 forks source link

Out Of Memory: Heap Space #156

Closed jeremyhenage closed 8 years ago

jeremyhenage commented 8 years ago

We run multiple cucumber tests in parallel, and dump all the reports to a common folder. When we run 10 or more parallel tests, the cucumber reports plugin fails with an out of memory exception:

CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] Copying all json files from: D:\UDU\DU\aw31_cuc_all\target to reports directory: C:\Program Files (x86)\Jenkins\jobs\AW 3.1 Cucumber All\builds\108\cucumber-html-reports [CucumberReportPublisher] Found 1 json files. [CucumberReportPublisher] 1. Found a json file: cucumber-json-report.json [CucumberReportPublisher] Generating HTML reports FATAL: Java heap space java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source) at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source) at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at com.google.gson.stream.JsonReader.nextQuotedValue(JsonReader.java:1028) at com.google.gson.stream.JsonReader.nextString(JsonReader.java:827) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:422) at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:410) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:117) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:217) at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) at com.google.gson.Gson.fromJson(Gson.java:861) at com.google.gson.Gson.fromJson(Gson.java:799) at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:35) at net.masterthought.cucumber.ReportBuilder.generateReports(ReportBuilder.java:49) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)

Is there any way to increase heap size via command line Xmx JVM parameter? I couldn't find anything in the settings, nor in any config files.

damianszczepanik commented 8 years ago

Attach json files so I can check what is going on

matulik commented 8 years ago

I have the same problem, also after Jenkins global parameter. On my local Jenkins server everything is fine (1.656) On production server (1.646) I got OutOfMemoryError or PermGen space error.

My .json file [ { "uri": "features/sample.feature", "id": "application-start", "keyword": "Feature", "name": "Application start", "description": "", "line": 1, "elements": [ { "id": "application-start;start-app", "keyword": "Scenario", "name": "Start app", "description": "", "line": 3, "type": "scenario", "before": [ { "match": { "location": "features/support/01_launch.rb:21" }, "result": { "status": "passed", "duration": 30158683000 } } ], "steps": [ { "keyword": "Given ", "name": "the app has launched", "line": 4, "match": { "location": "features/steps/sample_steps.rb:1" }, "result": { "status": "passed", "duration": 471210000 } }, { "keyword": "When ", "name": "Cheers! text is visible", "line": 5, "match": { "location": "features/steps/sample_steps.rb:7" }, "result": { "status": "passed", "duration": 203814000 } }, { "keyword": "Then ", "name": "app is ready to use", "line": 6, "match": { "location": "features/steps/sample_steps.rb:14" }, "result": { "status": "passed", "duration": 89000 } } ], "after": [ { "match": { "location": "features/support/01_launch.rb:31" }, "result": { "status": "passed", "duration": 308103000 } } ] } ] } ]

damianszczepanik commented 8 years ago

Works fo me. You need to check the JVM configuration and increase memory limitation