title: Java Heap Memory error
body: <p>I am getting this error:</p>
  
  <pre><code>Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
      at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:1585)
      at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1409)
      at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2886)
      at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:476)
      at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2581)
      at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1757)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2171)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2562)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2512)
      at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1476)
      at DBase.connect(automateExport.java:31)
      at automateExport.main(automateExport.java:10)
  </code></pre>
  
  <p>I tried to increase the heap memmory space by opening eclipse.ini file and then changing </p>
  
  <pre><code>-Xms 256m and -Xmx 512m
  </code></pre>
  
  <p>But that did not help. I tried 512m and 1024m but that ended up giving error: Failed to start JVM and eclipse did not open up.</p>
  
  <p>I tried doing the same on cmd line:</p>
  
  <pre><code>java -Xms 256m and -Xmx 512m
  </code></pre>
  
  <p>and also eclipse <code>-vmargs -Xms 256m and -Xmx 512m</code>
  But still no help.
  I am basically creating a JDBC connection to query the database for very large set of records.
  Please help me. </p>