Gatling heap dump error

I am using gatling gradle plugin with following jvm settings
jvmArgs = [’-server’, ‘-Xmx4G’,
‘-XX:+UseG1GC’, ‘-XX:MaxGCPauseMillis=30’,
‘-XX:G1HeapRegionSize=16m’,
‘-XX:InitiatingHeapOccupancyPercent=75’,
‘-XX:+ParallelRefProcEnabled’,
‘-XX:+PerfDisableSharedMem’,
‘-XX:+AggressiveOpts’,
‘-XX:+OptimizeStringConcat’,
‘-XX:+HeapDumpOnOutOfMemoryError’]

I still get the following error
ava.lang.OutOfMemoryError: Java heap space Dumping heap to java_pid18123.hprof … Heap dump file created [6748925284 bytes in 342.311 secs] Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “channel-receiver-mux2-inout-receive” Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “channel-receiver-mux3-inout-receive” Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “channel-receiver-mux0-inout-receive” Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “channel-receiver-mux1-inout-receive” Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “java-sdk-http-connection-reaper” Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “gatling-1-3” Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “gatling-1-5”

Couple of questions

  1. Does gatlng create any heap dump file and store it or is it created by JVM… I am sorry if this question is invalid.

  2. Can I increase ‘-Xmx4G’, to 6-8G…

Thanks
Sriharsha

You’re storing too much data in memory.
Possible causes:

  • you’re forcing huge large feeders in memory with “eager”

  • you’re loading huge feeder data with “readRecords”

  • you’re saving lots of data in virtual users’ Sessions with saveAs

  • you’re using throttle but are injecting way too many virtual users for your throttle (see throttling doc).