74@@ -75,11 +75,10 @@ bool CDBEnv::Open(const boost::filesystem::path& path)
75 if (GetBoolArg("-privdb", true))
76 nEnvFlags |= DB_PRIVATE;
77
78- unsigned int nDbCache = GetArg("-dbcache", 25);
79 dbenv.set_lg_dir(pathLogDir.string().c_str());
80- dbenv.set_cachesize(nDbCache / 1024, (nDbCache % 1024)*1048576, 1);
81- dbenv.set_lg_bsize(1048576);
82- dbenv.set_lg_max(10485760);
83+ dbenv.set_cachesize(0, 0x100000, 1); // 1 MiB should be enough for just the wallet
When would 1MB not be sufficient?
The wallet is always loaded entirely into RAM anyway, and only modified in small incremental ways, so a large cache shouldn’t ever be needed. However, when BDB was still used for the block chain database, we did require large caches to speed up prevout lookups during block validation. That part is now in LevelDB anyway.