I get this error:
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)
I tried to increase the heap memory space by opening the eclipse.ini file and then changing
-Xms 256m and -Xmx 512m
But it did not help. I tried 512 m and 1024 m, but it ended up giving an error: the JVM could not start, and the eclipse did not open.
I tried to do the same on the cmd line:
java -Xms 256m and -Xmx 512m
as well as eclipse -vmargs -Xms 256m and -Xmx 512m But still no help. I basically create a JDBC connection to query the database for a very large set of records. Please help me.
source share