title: Java Increase Heap size
body: <p>I have a java application form which i am accessing records from database,processing it and again updaing the database.
  I am doing this by converting my java application to JAR and executing it from command prompt.During testing there are only 20 records
  per table in database.For that i am executing the jar as follows to avoid out of memory error,</p>
  
  <pre><code>java -jar -Xmx512m MyApp.jar
  </code></pre>
  
  <p>If database contains much record(50,000),how to <strong>increase the heap size while executing jar</strong> or How to increase the heap size dynamically based on needs while executing the jar.</p>
  
  <p>Thanks</p>