I have a not big embeded database and when I want to script it using
org.h2.tools.Script class I get an Out of memory exception. The solution is
ofcourse to use more java heap space, by running class with -Xmx1024m
argument.

Exception stack tells me one thing:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Unknown Source)
        at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
        at java.lang.AbstractStringBuilder.append(Unknown Source)
        at java.lang.StringBuffer.append(Unknown Source)
        at org.h2.command.dml.ScriptCommand.query(ScriptCommand.java:282)
        at org.h2.command.CommandContainer.query(CommandContainer.java:81)
        at org.h2.command.Command.executeQueryLocal(Command.java:141)
        at org.h2.command.Command.executeQuery(Command.java:122)
        at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:76)
        at org.h2.tools.Script.process(Script.java:158)
        at org.h2.tools.Script.run(Script.java:109)
        at org.h2.tools.Script.main(Script.java:57)

H2 developers use StringBuffer to append new queries, I think the better
solution would be write to FileOutputStream - the out of memory problem will
not exist in this case.

--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to