dbTalk Databases Forums  

having trouble with Database.preload()

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss having trouble with Database.preload() in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
heng.mei@gmail.com
 
Posts: n/a

Default having trouble with Database.preload() - 11-14-2005 , 05:35 AM






Hi experts,
I'm using BDB-JE, and I want to preload the databases into memory when
my applicationloads up... However, I can't seem to get
Database.preload() to work.

I have over 1Gig of data the files in my bdb environment --but when I
call Database.preload(), the memory footprint of my process barely goes
up (only a few MB), whereas I was expecting the memory to max out.

I'm running my java process using -Xmx1500m option, and also have set
my environment config to use cachePercent=80%.

I've tried calling preload(0,0), which according to my interpretation
of the javadocs, should cause BDB to load as much of the indexes into
memory as possible.
I've also tried to call preload(1000000000, 1000000000), but that
doesn't seem to behave any differently.

Any ideas of what might be causing my problems?

Thanks!
~Heng


Reply With Quote
  #2  
Old   
mark@sleepycat.com
 
Posts: n/a

Default Re: having trouble with Database.preload() - 11-14-2005 , 02:57 PM






Hi Heng,

How many records are in the database, and what is the key size? Using
this information we can estimate the memory size for the index.

Please be aware that preload loads the index nodes only -- it does not
load the leaf nodes, in other words, it does not load the record data.
If you want to preload everything, use a cursor to walk through the
entire database instead of calling preload.

To verify that you're setting the cache size correctly, please print
out the stats after opening the environment as follows:

System.out.println(env.getStats(null));

Mark


Reply With Quote
  #3  
Old   
heng.mei@gmail.com
 
Posts: n/a

Default Re: having trouble with Database.preload() - 11-19-2005 , 02:46 AM



Thanks for the tips, Mark.

We now iterate through the entire database using Cursor.getNext(), and
the preloading works as we wish it to --
--- although the preloading takes a bit long (~1 hr).

Are there any tricks to help load the leaf nodes into memory faster?
(btw, our environment is opened as read-only).

Thanks,
~Heng


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.