Parsing log file(s)... java.lang.OutOfMemoryError: Java heap space

I am using Gatling 3.5.0,
I have 5 test case classes , each test case only send 1 HTTP request for 1 second.
I run 5 test cases one after the other.

The problem is after I run the test roughly 5 times using “mvn gatling:test” , I will get 1 Build Failure while parsing log file.

Parsing log file(s)…
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid89460.hprof …
Heap dump file created [1978735703 bytes in 7.614 secs]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at io.gatling.mojo.MainWithArgsInFile.runMain(
at io.gatling.mojo.MainWithArgsInFile.main(
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.lang.Integer.valueOf(
at scala.runtime.BoxesRunTime.boxToInteger(
at io.gatling.charts.stats.StatsHelper$.buckets(StatsHelper.scala:22)
at io.gatling.charts.stats.LogFileReader.(LogFileReader.scala:151)
… 6 more
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.185 s
[INFO] Finished at: 2020-12-23T16:07:04+13:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:3.1.0:test (default-cli) on project BeingWellRegisterLoginLoadTest: Gatling failed.: Process exited with an error: -1 (Exit value: -1) → [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

My POM.xml looks like this

<?xml version="1.0" encoding="UTF-8"?>


1.8 1.8 UTF-8


io.gatling.highcharts gatling-charts-highcharts ${gatling.version} io.gatling gatling-app ${gatling.version} io.gatling gatling-recorder ${gatling.version} src/test/scala maven-jar-plugin ${maven-jar-plugin.version} net.alchim31.maven scala-maven-plugin ${scala-maven-plugin.version} testCompile -Xss20G -Xms20G -Xmx100G -target:jvm-1.11 -deprecation -feature -unchecked -language:implicitConversions -language:postfixOps io.gatling gatling-maven-plugin ${gatling-maven-plugin.version} test ${project.basedir}/src/test/scala ${project.basedir}/src/test/resources ${project.basedir}/target/gatling


testCases.Register testCases.PersonalizeFormWithGUID testCases.Login testCases.GenerateToken testCases.Inquiry

When I downgrade the Gatling version to 3.3.1 , then I don’t see this error (I only have run it for 8 times so far and I didn’t get any Build Failure at all. Probably I will need to run it more later to further verify it)

My logback.xml looks like this

<?xml version="1.0" encoding="UTF-8"?> %d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx false ./src/test/resources/Logs ./src/test/resources/Logs/loadTest.log true %d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx

Is there any known issue with the newest Gatling version 3.5.0 , or something is not right with my POM.xml or my logback.xml ?


Please provide some concrete information such we can investigate, eg: your simulation.log, a heap dump (the aforementioned hprof file).

I’m just responding to say that I had this problem as wel. I’ve found the underlaying problem by adding the following logger to my log4j.xml

With the logging now showing all the failed request, I found out that there was something wrong with my testcase. I hope this helps somebody.