Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to load a BDB file into memory?

796529Oct 24 2010 — edited Oct 25 2010
The entire BDB database needs to reside in memory for performance reasons, it needs to be in memory all the time, not paged in on demand. The physical memory and virtual process address space are large enough to hold this file. How can I load it into memory just before accessing the first entry? I've read the C++ API reference, and it seems that I can do the following:
1, Create a DB environment;
2, Call DB_ENV->set_cachesize() to set a memory pool large enough to hold the BDB file;
3, Call DB_MPOOLFILE->open() to open the BDB file in memory pool of that DB environment;
4, Create a DB handle in that DB environment and open the BDB file (again) via this DB handle.

My questions are:
1, Is there a more elegant way instead of using that DB environment? If the DB environment is a must, then:
2, Does step 3 above load the BDB file into memory pool or just reserve enough space for that file?

Thanks in advance,
Feng
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2010
Added on Oct 24 2010
2 comments
268 views