Skip navigation links

MySQL Forums


Advanced Search

java.lang.OutOfMemoryError: Java heap space
Posted by: Yashodhan Kholgade ()
Date: October 10, 2009 08:10PM

I am trying to do "select * from table". This table has more than 500000 rows. When I do preparedStatement.executeQuery() or statement.executeQuery(...) following error is printed.

I tried to do setFetchSize(10000), however it was none of use.


Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1010)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:300)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1319)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1555)
at com.Table.grabTableData(Table.java:87)
at com.Metadata.readTableMetricsBySchema(Metadata.java:88)
at com.GrabDB.main(GrabDB.java:37)


Please help me to solve this error ASAP.

Options: ReplyQuote


Subject Written By Posted
java.lang.OutOfMemoryError: Java heap space Yashodhan Kholgade 10/10/2009 08:10PM


Sorry, only registered users may post in this forum.