I am getting out of memory error while uploading the csv file:
I have ran following command
java -XX:MaxPermSize=128m -Xms4096m -Xmx4096m -cp 
C:\temp\H2\h2-2017-04-23\h2\bin\h2-1.4.195.jar org.h2.tools.RunScript -url 
jdbc:h2:file:/Z:\2017_03_tmm\par;MV_STORE=FALSE\;MVCC=FALSE\;LOG=0\;CACHE_SIZE=65536\;LOCK_MODE=0\;UNDO_LOG=0
 
-user sa -password Ge1cSK2om3GmsSAV -script 
D:\scripts\python\h2\h2sql\pd.sql

I also increased from -Xms4096m -Xmx4096m  to -Xms20046m -Xmx25046m but 
still I am getting same error. My machine Ram is 64 GB

I also tried with these two option MAX_MEMORY_ROWS=100;\;DB_CLOSE_DELAY=-1 
but still getting same error

Error log
2017-07-06 15:29:15 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: Out of memory.; SQL statement:

CREATE TABLE PA_RETAIL_REAL_ESTATE.DATA(IDvarchar (12) PRIMARY KEY NOT 
NULL,FNAME varchar (50),MNAME varchar (50),LNAME varchar (50),SUFFIX 
varchar (10),FNAME2 varchar (50),MNAME2 varchar (50))) AS SELECT * FROM 
CSVREAD('Z:\\2017_03_gem\\PROP.txt', NULL, 'CHARSET=UTF-8 FIELDSEPARATOR=| 
FIELDDELIMITER=') [90108-195]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:289)
at org.h2.command.Command.executeUpdate(Command.java:266)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:193)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:165)
at org.h2.tools.RunScript.process(RunScript.java:261)
at org.h2.tools.RunScript.process(RunScript.java:191)
at org.h2.tools.RunScript.process(RunScript.java:329)
at org.h2.tools.RunScript.runTool(RunScript.java:142)
at org.h2.tools.RunScript.main(RunScript.java:69)
Caused by: java.lang.OutOfMemoryError: Java heap space
at org.h2.tools.Csv.readBuffer(Csv.java:408)
at org.h2.tools.Csv.readChar(Csv.java:393)
at org.h2.tools.Csv.readValue(Csv.java:445)
at org.h2.tools.Csv.readRow(Csv.java:570)
at org.h2.tools.SimpleResultSet.next(SimpleResultSet.java:222)
at 
org.h2.index.FunctionCursorResultSet.next(FunctionCursorResultSet.java:59)
at org.h2.index.IndexCursor.next(IndexCursor.java:305)
at org.h2.table.TableFilter.next(TableFilter.java:499)
at 
org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1452)
at org.h2.result.LazyResult.hasNext(LazyResult.java:79)
at org.h2.result.LazyResult.next(LazyResult.java:59)
at org.h2.command.dml.Select.queryFlat(Select.java:519)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:625)
at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:114)
at org.h2.command.dml.Query.query(Query.java:371)
at org.h2.command.dml.Insert.insertRows(Insert.java:167)
at org.h2.command.dml.Insert.update(Insert.java:114)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:192)
at org.h2.command.CommandContainer.update(CommandContainer.java:101)
at org.h2.command.Command.executeUpdate(Command.java:260)
... 7 more
2017-07-06 15:29:15 jdbc[3]: exception
org.h2.jdbc.JdbcSQLException: The database has been closed [90098-195]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.engine.Database.checkPowerOff(Database.java:524)
at org.h2.engine.Session.close(Session.java:830)
at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:395)
at org.h2.tools.RunScript.process(RunScript.java:331)
at org.h2.tools.RunScript.runTool(RunScript.java:142)
at org.h2.tools.RunScript.main(RunScript.java:69)
2017-07-06 15:29:15 database: close
org.h2.message.DbException: The database has been closed [90098-195]
at org.h2.message.DbException.convert(DbException.java:283)
at 
org.h2.store.LobStorageBackend.removeAllForTable(LobStorageBackend.java:204)
at org.h2.engine.Database.removeOrphanedLobs(Database.java:1340)
at org.h2.engine.Database.close(Database.java:1261)
at org.h2.engine.DatabaseCloser.run(DatabaseCloser.java:63)
Caused by: org.h2.jdbc.JdbcSQLException: The database has been closed 
[90098-195]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.engine.Database.checkPowerOff(Database.java:524)
at org.h2.command.Command.executeQuery(Command.java:227)
at 
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:111)
at 
org.h2.store.LobStorageBackend.removeAllForTable(LobStorageBackend.java:198)
... 3 more

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to