#include <db_cxx.h>

DbEnv::get_memory_init(DB_MEM_CONFIG struct, u_int32_t *countp);

The DbEnv::get_memory_init() method returns the number of objects to allocate and initialize when an environment is created. The count is returned for a specific named structure. The count for each structure is set using the DbEnv::set_memory_init() method.

The DbEnv::get_memory_init() method may be called at any time during the life of the application.

The DbEnv::get_memory_init() method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.



The struct parameter identifies the structure for which you want an object count returned. It must be one of the following values:


    Initialize locks. A thread uses this structure to lock a page (or record for the QUEUE access method) and hold it to the end of a transactions.


    Initialize lock objects. For each page (or record) which is locked in the system, a lock object will be allocated.


    Initialize lockers. Each thread which is active in a transactional environment will use a locker structure either for each transaction which is active, or for each non-transactional cursor that is active.


    Initialize the log fileid structures. For each database handle which is opened for writing in a transactional environment, a log fileid structure is used.


    Initialize transaction structures. Each active transaction uses a transaction structure until it either commits or aborts.


    Initialize thread identification structures. If thread tracking is enabled then each active thread will use a structure. Note that since a thread does not signal the BDB library that it will no longer be making calls, unused structures may accumulate until a cleanup is triggered either using a high water mark or by running DbEnv::failchk().


The countp parameter references memory into which object count for which the specified structure is copied.



See Also

Database Environments and Related Methods