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
October 10, 2009 08:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.