OOM on gatling

194 views
Skip to first unread message

shawn...@gmail.com

unread,
Jun 26, 2013, 6:53:05 PM6/26/13
to gat...@googlegroups.com
I am getting this when running gatling:

Dumping heap to java_pid8409.hprof ...
Heap dump file created [585273257 bytes in 5.761 secs]
Uncaught error from thread [GatlingSystem-akka.actor.default-dispatcher-7] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[GatlingSystem]
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOfRange(Arrays.java:2694)
    at java.lang.String.<init>(String.java:203)
    at java.nio.HeapCharBuffer.toString(HeapCharBuffer.java:561)
    at java.nio.CharBuffer.toString(CharBuffer.java:1201)
    at org.jboss.netty.buffer.ChannelBuffers.decodeString(ChannelBuffers.java:1207)
    at org.jboss.netty.buffer.AbstractChannelBuffer.toString(AbstractChannelBuffer.java:550)
    at org.jboss.netty.buffer.AbstractChannelBuffer.toString(AbstractChannelBuffer.java:542)
    at com.ning.http.client.providers.netty.NettyResponse.getResponseBody(NettyResponse.java:92)
    at io.gatling.http.response.GatlingResponse.getResponseBody(Response.scala:61)
    at io.gatling.http.check.HttpCheckBuilders$$anonfun$2.apply(HttpCheckBuilders.scala:36)
    at io.gatling.http.check.HttpCheckBuilders$$anonfun$2.apply(HttpCheckBuilders.scala:36)
    at io.gatling.core.check.CheckBase$$anonfun$memoizedPrepared$1$1.apply(Check.scala:53)
    at io.gatling.core.check.CheckBase$$anonfun$memoizedPrepared$1$1.apply(Check.scala:53)
    at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189)
    at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)
    at io.gatling.core.check.CheckBase.memoizedPrepared$1(Check.scala:53)
    at io.gatling.core.check.CheckBase.check(Check.scala:63)
    at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:30)
    at io.gatling.http.check.HttpCheck.check(HttpCheck.scala:29)
    at io.gatling.core.check.Checks$$anonfun$check$1$$anonfun$apply$1.apply(Check.scala:30)
    at io.gatling.core.check.Checks$$anonfun$check$1$$anonfun$apply$1.apply(Check.scala:30)
    at io.gatling.core.validation.Success.flatMap(Validation.scala:27)
    at io.gatling.core.check.Checks$$anonfun$check$1.apply(Check.scala:30)
    at io.gatling.core.check.Checks$$anonfun$check$1.apply(Check.scala:29)
    at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
    at scala.collection.immutable.List.foldLeft(List.scala:84)
    at io.gatling.core.check.Checks$.check(Check.scala:29)
    at io.gatling.http.ahc.GatlingAsyncHandlerActor.checkAndProceed$1(GatlingAsyncHandlerActor.scala:224)
    at io.gatling.http.ahc.GatlingAsyncHandlerActor.io$gatling$http$ahc$GatlingAsyncHandlerActor$$processResponse(GatlingAsyncHandlerActor.scala:237)
    at io.gatling.http.ahc.GatlingAsyncHandlerActor$$anonfun$receive$1.applyOrElse(GatlingAsyncHandlerActor.scala:103)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
    at akka.actor.ActorCell.invoke(ActorCell.scala:386)
Message has been deleted

shawn...@gmail.com

unread,
Jun 26, 2013, 11:35:49 PM6/26/13
to gat...@googlegroups.com
I am getting it quite often now even i am up the xmx to 3072M (used to be 512M).

My scenario is a little bit tricky, since as requested, our testing scenarios are long sessions from the start of the run to the end of the run.  So I guess probably that is why the memory can not be released and cause this OOM?

Any help on this?

Stéphane Landelle

unread,
Jun 27, 2013, 1:09:26 AM6/27/13
to gat...@googlegroups.com
Well, I would need your heap dump.
Would you happen to do your own stuff with the response bodies, like saving them into the Session (willingly, or unwillingly, like doing a substring or a regex and saving the result)?


2013/6/27 <shawn...@gmail.com>
I am getting it quite often now even i am up the xmx to 3072M (used to be 512M).

My scenario is a little bit tricky, since as requested, our testing scenarios are long sessions from the start of the run to the end of the run.  So I guess probably that is why the memory can not be released and cause this OOM?

Any help on this?


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nicolas Rémond

unread,
Jun 27, 2013, 1:13:42 AM6/27/13
to gat...@googlegroups.com
Add this option to Java for the heap dump:  -XX:+HeapDumpOnOutOfMemoryError 

shawn...@gmail.com

unread,
Jun 27, 2013, 3:10:28 AM6/27/13
to gat...@googlegroups.com
Yeah, I do need to save some bodyString to parse since the regex does not fit me.  Should I use the tranform function instead of saving the body string in sessions and do the parse there?  Will that make differences?

Stéphane Landelle

unread,
Jun 27, 2013, 3:48:55 AM6/27/13
to gat...@googlegroups.com
Yes, you should be using transform so that you only save the bits you're interested in and the body strings can be garbage collected ASAP.
If you don't/can't do that, at least remove the attributes storing body strings as soon as you're done parsing them.


2013/6/27 <shawn...@gmail.com>
Yeah, I do need to save some bodyString to parse since the regex does not fit me.  Should I use the tranform function instead of saving the body string in sessions and do the parse there?  Will that make differences?

shawn...@gmail.com

unread,
Jun 27, 2013, 12:35:37 PM6/27/13
to gat...@googlegroups.com
Ok I will remove those attributes from the sessions after done.

So I am using 2.0.0M.
https://github.com/excilys/gatling/wiki/Gatling-2

Does session still have the removeAttribute functions?  Seems like it goes away for 2.0.0.  What's the best way to do that?

session.set(attributeName, null)?

shawn...@gmail.com

unread,
Jun 27, 2013, 1:07:56 PM6/27/13
to gat...@googlegroups.com
BTW,  Do you have some good examples on how to use transform function?  I looked at wiki one, it is pretty simple.  Want to get more help on how to write those


shawn...@gmail.com

unread,
Jun 28, 2013, 1:25:50 AM6/28/13
to gat...@googlegroups.com
Never mind, it is more about scala, I can figure it out by myself

Thx for the help!

Reply all
Reply to author
Forward
0 new messages