dbTalk Databases Forums  

question about dbenv->memp_stat_print(0)

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


Discuss question about dbenv->memp_stat_print(0) in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe
 
Posts: n/a

Default question about dbenv->memp_stat_print(0) - 08-04-2006 , 12:38 PM






Hi,

I have some question to ask. When I try to use
dbenv->memp_stat_print(0) to catch the usage of cache, the information
of databases associated with the environment is repetitively outputted
many times. Can anybody tell me the reason or how to avoid outputting
them?

For example, I have three databases associated witht the environment
dbenv, which are db1, db2, db3, respectively. I use
dbenv->memp_stat_print(0) at the end of my program and the output look
like this:

81KB 900B Total cache size
1 Number of caches
88KB Pool individual cache size
.... .... ... ...
1 The max number of pages examined for an allocation

Pool File: db1.db
512 Page size
..... ....

Pool File: db2.db
512 Page size
..... ....

Pool File: db3.db
512 Page size
..... ....

Pool File: db1.db
512 Page size
..... ....

Pool File: db2.db
512 Page size
..... ....

Pool File: db3.db
512 Page size
..... ....

Pool File: db1.db
512 Page size
..... ....

Pool File: db2.db
512 Page size
..... ....

Pool File: db3.db
512 Page size
..... ....

..... ....

The information of db1 to db3 will be outputted many times as shown
above.

Regards,
Joe


Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: question about dbenv->memp_stat_print(0) - 08-07-2006 , 05:06 PM







Joe wrote:
Quote:
I have some question to ask. When I try to use
dbenv->memp_stat_print(0) to catch the usage of cache, the information
of databases associated with the environment is repetitively outputted
many times. Can anybody tell me the reason or how to avoid outputting
them?
I am unable to reproduce this problem. A simple test:

int
main(int argc, char *argv[])
{
DB_ENV *dbenv;
DB *dbp;

(void)system("rm -rf TESTDIR; mkdir TESTDIR");

assert(db_env_create(&dbenv, 0) == 0);
dbenv->set_errfile(dbenv, stderr);
assert(dbenv->open(
dbenv, "TESTDIR", DB_CREATE | DB_INIT_MPOOL, 0666) == 0);

assert(db_create(&dbp, dbenv, 0) == 0);
assert(dbp->set_pagesize(dbp, 512) == 0);
assert(dbp->open(dbp, NULL,
"data1", NULL, DB_BTREE, DB_CREATE, 0666) == 0);

assert(db_create(&dbp, dbenv, 0) == 0);
assert(dbp->set_pagesize(dbp, 512) == 0);
assert(dbp->open(dbp, NULL,
"data2", NULL, DB_BTREE, DB_CREATE, 0666) == 0);

assert(db_create(&dbp, dbenv, 0) == 0);
assert(dbp->set_pagesize(dbp, 512) == 0);
assert(dbp->open(dbp, NULL,
"data3", NULL, DB_BTREE, DB_CREATE, 0666) == 0);

assert(dbenv->memp_stat_print(dbenv, 0) == 0);

return (0);
}

works correctly for me, displaying only the 3 open databases and then
exiting.

Can you email me any kind of reproducible test case so I could see this
problem happen?

Regards,
--keith

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic
Oracle Corporation
keith.bostic (AT) oracle (DOT) com
keithbosticim (Yahoo IM)



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.