java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid12583.hprof ...
Heap dump file created [445043187 bytes in 3.202 secs]
Uncaught error from thread [GatlingSystem-akka.actor.default-dispatcher-3] 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.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
at java.io.OutputStream.write(OutputStream.java:75)
at com.jivesoftware.cloudalytics.util.SnappyUtils.combine(SnappyUtils.java:37)
at com.jivesoftware.cloudalytics.util.SnappyUtils.snappyCompress(SnappyUtils.java:44)
at com.jivesoftware.cloudalytics.performance.CloudalyticsPerfTestDataUtils.convertToPostStringEntity(CloudalyticsPerfTestDataUtils.java:42)
at cloudalytics.atom.EventUtils$$anonfun$1.apply(EventUtils.scala:30)
at cloudalytics.atom.EventUtils$$anonfun$1.apply(EventUtils.scala:27)
at io.gatling.core.action.SessionHook.executeOrFail(SessionHook.scala:35)
at io.gatling.core.action.Failable$class.execute(Actions.scala:82)
at io.gatling.core.action.SessionHook.execute(SessionHook.scala:28)
at io.gatling.core.action.Action$$anonfun$receive$1.applyOrElse(Actions.scala:42)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:166)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
at akka.actor.ActorCell.invoke(ActorCell.scala:386)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
at akka.dispatch.Mailbox.run(Mailbox.scala:212)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
The OOM happens to one of our libraries. But when I bump up the memory in the “gatling command line” it started working. For maven plugin, when I tried to bump up it still does not work
public static final String[] JVM_ARGS = new String[] { "-server", "-XX:+UseThreadPriorities", "-XX:ThreadPriorityPolicy=42", "-Xms512M", "-Xmx512M", "-Xmn100M", "-Xss2M",
"-XX:+HeapDumpOnOutOfMemoryError", "-XX:+AggressiveOpts", "-XX:+OptimizeStringConcat", "-XX:+UseFastAccessorMethods", "-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC",
"-XX:+CMSParallelRemarkEnabled", "-XX:+CMSClassUnloadingEnabled", "-XX:CMSInitiatingOccupancyFraction=75", "-XX:+UseCMSInitiatingOccupancyOnly", "-XX:SurvivorRatio=8",
"-XX:MaxTenuringThreshold=1" };
private List<String> jvmArgs() {
List<String> jvmArguments = (jvmArgs != null) ? jvmArgs : new ArrayList<String>();
jvmArguments.addAll(Arrays.asList(JVM_ARGS));
return jvmArguments;
}
Seems like the default JVM_ARGS get written to the jvmArgs anyhow. Even I specified the Xmx in the pom?
seem
In most JVM I know, in case of duplicates, the last options take precedence, which is exactly the opposite that we want. However, this is very JVM dependent and we’d better completely override.
Was wondering if this particular fix would be back-ported to gatling-maven-plugin 1.5.3 ? (I seem to be getting OOM errors regardless the -Xmx4096m setting.
And, I don’t think I am inadvertently hanging on to anything in the actual scenario that gets run, for example.
I’d also guess that gatling-maven-plugin 2.0.0-SNAPSHOT is incompatible with Gatling 1.5.3?
I’ll have to check, but I thing the maven plugin is backward compatible so far. The version was upgraded because of the groupId change.
I can release a 1.5.4 beginning of next week. Please ping me, I’ll probably forgot.
Weird.
Do you have any idea about the origin of those OOM? If you migrate to Gatling 2M4 someday (once it is released of course) and you still get those, I’d gladly have a look at the heap dump.
What exactly do I need to do to get this working? This is my pom, and I’m just not getting anywhere. I’d prefer bumping up to 4g, but I’m stuck at 500m
4.0.0
io.gatling
gatling-maven-plugin-demo
2.0.0-SNAPSHOT
jar
local
local Repository
file:///home/twc-user/.m2/repository
I spent 1h yesterday trying to release a maven project.
Deploy was failing because some plugin didn’t have a fixed version (no idea which one), was automatically upgraded, and didn’t work properly with the other ones…