# Gatling session is holding too much of data that my scale test is throwing OutOfMemory exceptions and crashing

**URL:** <https://community.gatling.io/t/gatling-session-is-holding-too-much-of-data-that-my-scale-test-is-throwing-outofmemory-exceptions-and-crashing/3921>\
**Category:** Gatling (Open-Source)\
**Created:** [September 7, 2017, 5:46am UTC](https://community.gatling.io/t/gatling-session-is-holding-too-much-of-data-that-my-scale-test-is-throwing-outofmemory-exceptions-and-crashing/3921 "2017-09-07T05:46:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkontham](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@mkontham](https://community.gatling.io/u/mkontham)\
**Post date:** [September 7, 2017, 5:46am UTC](https://community.gatling.io/t/gatling-session-is-holding-too-much-of-data-that-my-scale-test-is-throwing-outofmemory-exceptions-and-crashing/3921/1 "2017-09-07T05:46:05Z")

</div>

Hi,

I have a gatling script for a salesforce application where I have some session variables that I m putting it in session. Due to this the session is holding too much of data and occupying more heap.  
After some 600 users my scale test would crash due to outofmemory exceptions.

How can i clear this session data after I use it or what is the alternative option to hold the captured data from any response?

 ![Pasted image at 2017_09_06 09_08 PM.png](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/1X/19ab4ebfc9db11b216eb8231823de5d050c09467.png)

---

<div class="post-metadata">

**Author:** ![Ivan\_S](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@Ivan\_S](https://community.gatling.io/u/Ivan_S)\
**Post date:** [September 17, 2017, 11:47am UTC](https://community.gatling.io/t/gatling-session-is-holding-too-much-of-data-that-my-scale-test-is-throwing-outofmemory-exceptions-and-crashing/3921/2 "2017-09-17T11:47:50Z")

</div>

According to documentation, if you don’t do checks on response bodies, they are discarded.  
Alternatively you could allow the jvm to use more RAM if those checks are actually needed.  
You could see an example here: [http://gatling.io/docs/2.3/extensions/sbt\_plugin](http://gatling.io/docs/2.3/extensions/sbt_plugin) (scroll to bottom of page)
