Hi, The system runs out of memory while parsing the SQL statement. Parsing a SQL statement doesn't need much memory. Probably the system is already very low on memory before that. So it's most likely just a coincidence that the problem occurs at this point.
Could you use a memory analysis tool to find out where the problem is? For example using EclipseMAT: http://www.eclipse.org/mat/ Regards, Thomas On Mon, Nov 16, 2009 at 6:29 PM, MrWhite <[email protected]> wrote: > I use an embedded h2 database with a file backend. Inserting about > 20.000 rows in two tables (10.000 in each) works ok. Its getting > dramatically slower after 10.000. But it is still working. > > After that i am trying to retrieve 10.000 objects . I am doing that > object for object and not in a single query. I am wondering because i > think the query is not that "expensive" especially because there are > no relations involved to other tables. > > select this_.chatmessage_id as chatmess1_25_0_, this_.chatmessage_hash > as chatmess2_25_0_, this_.chatmessage_text as chatmess3_25_0_, > this_.chatmessage_counter as chatmess4_25_0_, > this_.chatmessage_created as chatmess5_25_0_ from chatmessage this_ > where this_.chatmessage_id=? limit ? > > Caused by: java.lang.OutOfMemoryError: Java heap space > at java.util.Arrays.copyOfRange(Arrays.java:3209) > at java.lang.String.<init>(String.java:155) > at org.h2.util.StringCache.getNew(StringCache.java:92) > at org.h2.command.Parser.read(Parser.java:2579) > at org.h2.command.Parser.readIf(Parser.java:2532) > at org.h2.command.Parser.readTerm(Parser.java:2230) > at org.h2.command.Parser.readFactor(Parser.java:1850) > at org.h2.command.Parser.readSum(Parser.java:1837) > at org.h2.command.Parser.readConcat(Parser.java:1810) > at org.h2.command.Parser.readCondition(Parser.java:1681) > at org.h2.command.Parser.readAnd(Parser.java:1661) > at org.h2.command.Parser.readExpression(Parser.java:1653) > at org.h2.command.Parser.parseSelectSimpleSelectPart(Parser.java: > 1568) > at org.h2.command.Parser.parseSelectSimple(Parser.java:1598) > at org.h2.command.Parser.parseSelectSub(Parser.java:1503) > at org.h2.command.Parser.parseSelectUnion(Parser.java:1348) > at org.h2.command.Parser.parseSelect(Parser.java:1336) > at org.h2.command.Parser.parsePrepared(Parser.java:395) > at org.h2.command.Parser.parse(Parser.java:291) > at org.h2.command.Parser.parse(Parser.java:263) > at org.h2.command.Parser.prepareCommand(Parser.java:235) > at org.h2.engine.Session.prepareLocal(Session.java:416) > at org.h2.engine.Session.prepareCommand(Session.java:377) > at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java: > 1049) > at org.h2.jdbc.JdbcPreparedStatement.<init> > (JdbcPreparedStatement.java:73) > at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java: > 233) > at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement > (AbstractBatcher.java:534) > at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement > (AbstractBatcher.java:452) > at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement > (AbstractBatcher.java:161) > at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java: > 1577) > at org.hibernate.loader.Loader.doQuery(Loader.java:696) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections > (Loader.java:259) > > -- > > You received this message because you are subscribed to the Google Groups "H2 > Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=. > > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=.
