Hi,

I've switched over to the new page store, version 1.2.128. I haven't done tests, but a lot of things appear to be faster than before which is nice (and database size is much smaller!!)

Anyway, my issue is related to the SCRIPT TO command. I am running out of heap space and it seems to use a lot of memory.

This is my code.

             Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:file:db/db", "sa", "sa"); Statement s = conn.createStatement(); s.execute("SCRIPT DROP TO 'backup/backup_script.ZIP' COMPRESSION ZIP"); conn.close();


I'm executing it with

java -Xmx256m -classpath "h2.jar;" utils.ScriptDb

and this is the stack trace

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.StringBuilder.append(Unknown Source)
       at org.h2.command.dml.ScriptCommand.add(ScriptCommand.java:532)
       at org.h2.command.dml.ScriptCommand.query(ScriptCommand.java:270)
       at org.h2.command.CommandContainer.query(CommandContainer.java:81)
       at org.h2.command.Command.executeQuery(Command.java:132)
       at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:172)
       at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:151)
       at utils.ScriptDb.main(ScriptDb.java:31)



And my database is 208MB in size, containing 2 tables.

I can just increase the heap size, but it seems like a LOT just to dump the database. I expected it would have taken a few MB if that...

And when this database grows to a few GB, I don't think the heap will go that big :)

Am I missing anything?


Cheers,

Ryan





--
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