Unanswered: java.sql.SQLException: Out of memory (Needed 268435428 bytes)
I got exception :
Caused by: java.sql.SQLException: Out of memory (Needed 268435428 bytes)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:2921)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:770)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.ja va:2258)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:4 21)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java :1384)
at com.mysql.jdbc.ServerPreparedStatement.serverExecu te
at com.mysql.jdbc.ServerPreparedStatement.executeInte rnal
I would say that your dataset is so large the Java VM is running out of allocated memory, but as r937 clearly states you haven't really provided us with a huge amount of info there. Personally I would check the line numbers provided there.
The number of bytes indicated by the error is 256Mb, so I would hazard a guess that you have a memory leak somewhere... Or your machine just doesn't have enough ram to cope with what you're doing. If your dataset is 256Mb that is pretty darned big...
The dataset is not at all big...
As it is not a production DB, it has total 5 tables with not more than 20 records each.
And the exception I said (java.sql.SQLException: Out of memory) is also not coming consistantly.
Initially I too thought that the query might require more memory... but it is very simple select query. This 'Out of memory' seems misleading to me.