Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Berkely DB > Re: Cursor read...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 1750 of 1805
Post > Topic >>

Re: Cursor read fail at exactly 40,000 record point

by "Gerard J. Nicol" <gerard.nicol@[EMAIL PROTECTED] > May 23, 2007 at 02:24 AM

Michael,

I was getting no errors from the database (even with verbose message).
I have just tracked down the problem to:

(1) The database cache was set to 1 GB on a machine with 8 GB of RAM.
(2) It would appear that Windows limits the per address space storage
to 1 GB.
(3) Each record is 300 bytes.
(4) I use a custom array function that automatically grows (via
realloc). In this case it was set to grow by 10,000 records each time.

It would appear that the database was monopolizing most of the
available address space memory. When the array grew and the record set
got large the realloc was requiring a lot of memory for both the
source and destination.

The array function was returning a failure after the array failed to
grow but I was not catching this.

So in the end it was not the database environment as such. It was the
database environment sucking up the RAM and leaving insufficient
contiguous memory for the rest of the application.

A work around for the problem was to reduce the cache size. I will
also fix the code to read through the record set twice, once to count
the records and a second time to populate the array with a single
malloc. It would be nice if you could count the keys between a key
range without having to read every record!

Thanks for taking an interest.

Gerard
 




 5 Posts in Topic:
Cursor read fail at exactly 40,000 record point
"Gerard J. Nicol&quo  2007-05-22 14:32:38 
Re: Cursor read fail at exactly 40,000 record point
michael.cahill@[EMAIL PRO  2007-05-22 21:56:36 
Re: Cursor read fail at exactly 40,000 record point
Philip Guenther <guent  2007-05-22 22:38:35 
Re: Cursor read fail at exactly 40,000 record point
"Gerard J. Nicol&quo  2007-05-23 02:24:32 
Re: Cursor read fail at exactly 40,000 record point
michael.cahill@[EMAIL PRO  2007-05-24 05:01:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 20:59:45 CDT 2008.