aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-03-29 02:48:59 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2013-03-29 03:02:52 +0100
commit2e3c76bf9857f5ac2814df9fd6b9b5b7a7eff88a (patch)
treec70692ecbf1f019f33d468aef241bb159943d410
parentdfd71bb4509d12c26e630bc671a542ad5bab4945 (diff)
Don't use -dbcache for BDB anymore
-dbcache was originally used to set the maximum buffer size in the BDB environment, and was later changed to set the chainstate cache and leveldb caches. No need to use it for BDB now that only the wallet remains there. This should reduce memory allocation (but not necessarily memory usage) a bit.
-rw-r--r--src/db.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 94629f3cad..e51d5d2cba 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -75,11 +75,10 @@ bool CDBEnv::Open(const boost::filesystem::path& path)
if (GetBoolArg("-privdb", true))
nEnvFlags |= DB_PRIVATE;
- unsigned int nDbCache = GetArg("-dbcache", 25);
dbenv.set_lg_dir(pathLogDir.string().c_str());
- dbenv.set_cachesize(nDbCache / 1024, (nDbCache % 1024)*1048576, 1);
- dbenv.set_lg_bsize(1048576);
- dbenv.set_lg_max(10485760);
+ dbenv.set_cachesize(0, 0x100000, 1); // 1 MiB should be enough for just the wallet
+ dbenv.set_lg_bsize(0x10000);
+ dbenv.set_lg_max(1048576);
dbenv.set_lk_max_locks(40000);
dbenv.set_lk_max_objects(40000);
dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug