title: Java: Memory cleanup after Thread execution
body: <p>We have a Java batch program that process large amounts of data.</p>
  
  <p>After processing this data why doesn't JVM clear the garbage immediately instead of waiting for next execution ?</p>
  
  <p>Based on what i have observed, data from the previous run remains as it is, until i manually shutdown the JVM or next scheduled run starts.</p>
  
  <p>I want the JVM to clear the data immediately so that, on the next scheduled run, it doesn't have to clear the garbage in parallel during then run, hopefully running faster.</p>
  
  <p>Appreciate your help.</p>
  
  <h2>Edit:</h2>
  
  <p>Really appreciate your quick response.</p>
  
  <p>I don't really see considerable performance impact on my process because of this garbage existence in the memory.
  But, it is eating away system RAM this whole time and impacting memory availability to other programs outside this JVM.</p>
  
  <p>Another problem i have is, during development and debugging this program, while the program runs i let it run but once done, to analyze the results, i have to open a few other applications which obviously need a bit of RAM but the JVM doesn't relinquish RAM space unless i Stop it, affecting other programs usability and performance.</p>