title: How to get rid off java.lang.OutOfMemoryError: Java heap space
body: <p>I have went through many links and similar questions related to  <strong>java.lang.OutOfMemoryError: Java heap space</strong> but none of the solutions resolved my problem. So here is my question,
  I have a web application where user uploads a Excel file that has records around 2500 my application reads contents of this file and inserts them into Database.
  but after inserting 700 records I am getting exception as <strong>throwable object caught= java.lang.OutOfMemoryError: Java heap space</strong></p>
  
  <p>Same code works if file contains 500 or less than 500 records. following is my JAVA_OPTS &amp; CATALINA_OPTS variable in catalina.bat file</p>
  
  <pre><code>    JAVA_OPTS=-Xmx1536m -XX:MaxPermSize=128m
      CATALINA_OPTS=-Xms512m -Xmx512m
  </code></pre>
  
  <p>can anyone please tell me what can be done to resolve this issue?</p>