title: JMeter 5.1 java.lang.OutOfMemoryError: Java heap space - clear results does not help (did in 2.13)
body: <p>I've recently switched from 2.13 JMeter to 5.1. In 2.13 when java gave out of memory error, I clicked <code>Clear all</code> button and it helped. Now in 5.1 I've got error.</p>
  
  <blockquote>
    <p>ERROR:o.a.j.JMeter: Uncaught exception: 
    java.lang.OutOfMemoryError: Java heap space</p>
  </blockquote>
  
  <p>After some runs and some data accumulated in view results tree, but clear button does not help - view results tree becomes empty but error persists and Java mission control shows heap have not been reduced. Could it be some incorrect JMeter config or?  </p>
  
  <p>ADDED: Thank you for heap size settings tips. It's for smoke (debug) runs, I know I can increase heap, the question is as stated about clear command behavior and possible difference between versions.  </p>
  
  <p>BTW, I've also tried do invoke GC <code>jcmd &lt;pid as reported by task manager in windows&gt; GC.run</code> as per <a href="https://stackoverflow.com/questions/3523837/how-do-you-force-garbage-collection-from-the-shell">How do you Force Garbage Collection from the Shell?</a> - head was not reduced, which as I understand means JMeter does not release pointers to old java objects.</p>