Two things to try:
Re-create the table as a cached table (you can rename the original, create the new,
then move all the rows into the new table). You probably want to back up before,
because you will need to remove all of the rows from the original memory table.
This strategy will decrease performance when working with this table.
Use the -Xmx argument to "java" when starting up the server-side process. (If
you aren't using a HSQLDB Server, then this is just your JDBC process). This
strategy will require the use of more of the RAM from your computer.
Sanjeev Tripathi wrote:
Hi, I am getting out of memory exception when trying to insert 1 million row to the hsql database. I am successfully able to insert around 300,000 rows but I get error when try to insert more then that.
Here is out of my program:
Processing the row number 311845
Processing the row number 311846
java.lang.OutOfMemoryError
java.sql.SQLException: out of memory
at org.hsqldb.Trace.getError(Unknown Source)
at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
at org.hsqldb.jdbcConnection.execute(Unknown Source)
at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbcStatement.executeUpdate(Unknown Source)
at com.parago.thickclient.HSQLDBTest.update(HSQLDBTest.java:100)
at com.parago.thickclient.HSQLDBTest.main(HSQLDBTest.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
total time taken is in MiliSeconds 117082
total time taken is in Seconds 117
total time taken is in Minutes 1
total time taken is in Hours 0
java.lang.OutOfMemoryError
I was executing following code:
long start = System.currentTimeMillis();
try {
for (int j = 1; j < 5416 * 238; j++) {
System.out.println("Processing the row number " + j);
db.update("INSERT INTO COUNTRY_LOOKUP( COUNTRY_LOOKUP_ID, COUNTRY_CODE, COUNTRY_NAME) VALUES( 99,'IN', 'INDIA')");
conn.commit();
}
long end = System.currentTimeMillis();
long total = end - start;
System.out.println("total time taken is in MiliSeconds " + total);
System.out.println("total time taken is in Seconds " + total / 1000);
System.out.println("total time taken is in Minutes " + total / (1000 * 60));
System.out.println("total time taken is in Hours " + total / (1000 * 60 * 60));
// do a query
db.query("SELECT * FROM COUNTRY_LOOKUP");
db.rowCount("SELECT count(*) FROM COUNTRY_LOOKUP");
// at end of program
db.shutdown();
} catch (Exception e) {
e.printStackTrace();
long end = System.currentTimeMillis();
long total = end - start;
System.out.println("total time taken is in MiliSeconds " + total);
System.out.println("total time taken is in Seconds " + total / 1000);
System.out.println("total time taken is in Minutes " + total / (1000 * 60));
System.out.println("total time taken is in Hours " + total / (1000 * 60 * 60));
try {
db.shutdown();
} catch (Exception exp) {
}
Please suggest me how to get rid of this error.
-sanjeev tripathi
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 11:52 AM To: Sanjeev Tripathi Subject: Spam: Welcome to the "hsqldb-developers" mailing list
Welcome to the hsqldb-developers@lists.sourceforge.net mailing list!
To post to this list, send your email to:
hsqldb-developers@lists.sourceforge.net
General information about the mailing list is at:
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers
If you ever want to unsubscribe or change your options (eg, switch to or from digest mode, change your password, etc.), visit your subscription page at:
https://lists.sourceforge.net/lists/options/hsqldb-developers/sanjeev.tr ipathi%40parago.com
You can also make such adjustments via email by sending a message to:
[EMAIL PROTECTED]
with the word `help' in the subject or body (don't include the quotes), and you will get back a message with instructions.
You must know your password to change your options (including changing the password, itself) or to unsubscribe. It is:
deepali2
If you forget your password, don't worry, you will receive a monthly reminder telling you what all your lists.sourceforge.net mailing list passwords are, and how to unsubscribe or change your options. There is also a button on your options page that will email your current password to you.
You may also have your password mailed to you automatically off of the Web page noted above.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
hsqldb-developers mailing list
hsqldb-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hsqldb-developers
-- ICF: 703-934-3692 Cell: 703-944-9317
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ hsqldb-developers mailing list hsqldb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hsqldb-developers