Don’t use -dbcache for BDB anymore #2422

pull sipa wants to merge 1 commits into bitcoin:master from sipa:nowalcache changing 1 files +3 −4
  1. sipa commented at 2:07 am on March 29, 2013: member

    -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, especially when -dbcache is set high.

  2. 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.
    2e3c76bf98
  3. jgarzik commented at 2:16 am on March 29, 2013: contributor
    Does init.cpp want updating, too?
  4. sipa commented at 2:26 am on March 29, 2013: member
    @jgarzik Not that know of?
  5. gavinandresen commented at 6:51 pm on March 29, 2013: contributor
    ACK
  6. Diapolo commented at 8:42 pm on March 29, 2013: none
    Perhaps @jgarzik was talking about the help message? Set database cache size in megabytes (default: 25)
  7. sipa commented at 9:38 pm on March 29, 2013: member
    @Diapolo @jgarzik -dbcache is still the intended database cache, but we shouldn’t use that number both for the coincache/leveldb AND bdb.
  8. in src/db.cpp: in 2e3c76bf98
    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
    


    rebroad commented at 2:39 am on March 30, 2013:
    When would 1MB not be sufficient?

    sipa commented at 4:52 pm on March 30, 2013:
    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.
  9. TheBlueMatt commented at 7:01 am on March 30, 2013: member
    ACK
  10. BitcoinPullTester commented at 8:32 am on March 30, 2013: none
    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/2e3c76bf9857f5ac2814df9fd6b9b5b7a7eff88a for binaries and test log. This is an automated test script which runs test cases on each commit every time is updated. It, however, dies sometimes and fails to test properly, if you are waiting on a test, please check timestamps and if the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ and contact BlueMatt on freenode if something looks broken.
  11. jgarzik commented at 4:17 am on March 31, 2013: contributor
    ACK
  12. sipa referenced this in commit 767fe14a27 on Mar 31, 2013
  13. sipa merged this on Mar 31, 2013
  14. sipa closed this on Mar 31, 2013

  15. sipa deleted the branch on May 3, 2013
  16. laudney referenced this in commit 0e774a6068 on Mar 19, 2014
  17. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-18 10:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me