No more Java Heap space

Hello everyone,

I’m using the latest version of Gatling 2.2.3.
I’m doing a scenario that does 10 types of REST requests (get, put,post).
I must have 1 user = 1 request = 1 connection.
My run must last 200 minutes and we go upto 200 req/s during the peak for over an hour.
I use the feed csv function.
Example for one scenario

val baseUrl = getProperty(“baseUrl”, “http://myadress:11550”)

val myHttpProtocol = http

object UC1Process {

val myHttpReadRequest1 = http(“UC1 Get client info”)
.header(“x-CentraSite-APIKey”, “xxxxxxxxxxxxx”)
.basicAuth(“User”, “XXX”)


val GetClient = scenario(“UC1 Get client info”)

My csv file is 3MB (over 700000 ids)

My set up for one scenario:

rampUsersPerSec(1) to 20 during(10 minutes), // Pre-Heat
constantUsersPerSec(20) during(25 minutes) , // Stabilization 1
rampUsersPerSec(20) to 200 during(45 minutes), // Ramp-Up
constantUsersPerSec(200 ) during(60 minutes) , // Stabilization 2
rampUsersPerSec(200) to (20) during(45 minutes), // Tear-down
constantUsersPerSec(20) during(15minutes) // Stabilization 3

I started with the default conf of Gatling, and when we got the heap space problems, we bumped it to 8GB

JDK8 is installed on the server.

Our conf is the following on Gatling :

DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -Xmx8G" [The default was 1GB, we tried with 2G, 4G and then 8GB - we have up to 16GB of memory on the server]

DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -XX:+UseG1GC -XX:MaxGCPauseMillis=30 -XX:G1HeapRegionSize=16m -XX:InitiatingHeapOccupancyPercent=75 -XX:+ParallelRefProcEnabled"

DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -XX:+PerfDisableSharedMem -XX:+AggressiveOpts -XX:+OptimizeStringConcat"



On my conf file I have changed the following only (non commented), the rest is the default settings :

ahc {

keepAlive = false # Allow pooling HTTP connections (keep-alive header automatically added)

#connectTimeout = 6000 # Timeout when establishing a connection

#handshakeTimeout = 10000 # Timeout when performing TLS hashshake

pooledConnectionIdleTimeout = 10 # Timeout when a connection stays unused in the pool

#readTimeout = 6000 # Timeout when a used connection stays idle

My scenario stops around 260 mins in, i run out of heap memory when I just launch one kind of request… i tried all 10 at the same time… lasted 30 mins.

So i guess gatling keeps in memory all my requests … how do i stop this behaviour?

Thanks for your suggestions.

Kind Regards

Valeria G.