Chapter 9.  The DbMpoolFile Handle

#include <db_cxx.h>

class DbMpoolFile { 
public: 
        DB_MPOOLFILE *DbMpoolFile::get_DB_MPOOLFILE(); 
        const DB_MPOOLFILE *DbMpoolFile::get_const_DB_MPOOLFILE() const; 
        ... 
}; 

The memory pool interfaces for the Berkeley DB database environment are methods of the DbEnv handle. The DbEnv memory pool methods and the DB_MPOOLFILE class provide general-purpose, page-oriented buffer management of files. Although designed to work with the other Dbclasses, they are also useful for more general purposes. The memory pools are referred to in this document as simply the cache.

The cache may be shared between processes. The cache is usually filled by pages from one or more files. Pages in the cache are replaced in LRU (least-recently-used) order, with each new page replacing the page that has been unused the longest. Pages retrieved from the cache using DbMpoolFile::get() are pinned in the cache until they are returned to the control of the cache using the DbMpoolFile::put() method.

The DbMpoolFile object is the handle for a file in the cache. The handle is not free-threaded. Once the DbMpoolFile::close() method is called, the handle may not be accessed again, regardless of that method's return.

Memory Pools and Related Methods