RawrUniversal / xerial

Automatically exported from code.google.com/p/xerial
0 stars 1 forks source link

java.sql.SQLException: out of memory #78

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile the 2 attached java files.
2. Run Sample.java. It will produce C:/backup/sample.db. It will take couple of 
minutes because it creates 1M+ rows
3. Run Mutiple.java. This creates 50 threads. All threads have connection to 
sample.db and run a query.

What is the expected output? What do you see instead?
I expect all of them to run to completion. Instead I see java.sql.SQLException: 
out of memory
I expect sqlite to use virtual memory. It does not seem to use virtual memory. 
The javaw.exe uses 1.1GB memory and throws this exception

What version of the product are you using? On what operating system?
sqlite-jdbc 3.6.16

OS:
 Windows 7 (dual core, 4GB RAM, 32bit OS) 

Please provide any additional information below.
Note that I am using PRAGMA page_size=32768
When I don't set this number, the memory consumption is less.
Our application writes out lot dbs each in the order of several MB to few GB. 
Some times the dbs are on the network. So page_size has to be big.

Original issue reported on code.google.com by hkos...@yahoo.com on 3 Sep 2010 at 2:30

Attachments:

GoogleCodeExporter commented 8 years ago
To workaround this, we set 
PRAGMA cache_size =100

Original comment by hkos...@yahoo.com on 3 Sep 2010 at 7:07

GoogleCodeExporter commented 8 years ago
Actually, this may not be a bug. Since the default cache size is 2000 and the 
page size we are setting is 32768 bytes. The total memory cache is (2000x32768) 
per db. So it is running out of memory.

Original comment by hkos...@yahoo.com on 7 Sep 2010 at 1:56

GoogleCodeExporter commented 8 years ago

Original comment by taroleo on 8 Sep 2010 at 12:58

GoogleCodeExporter commented 8 years ago

Original comment by taroleo on 26 Oct 2010 at 7:06