diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-11 08:43:06 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-11 08:43:06 +0200 |
commit | ea100c73fae8a134c6ae2f1e39f557448734e012 (patch) | |
tree | 76a3261affb42d68d12f9758683bc9f0730711b8 | |
parent | f5d99075bfe57006270e7f6271b1340148f45b84 (diff) | |
download | bitcoin-ea100c73fae8a134c6ae2f1e39f557448734e012.tar.xz |
Reduce maximum coinscache size during verification
Due to growing coinsviewcaches, the memory usage with checklevel=3
(and standard settings for dbcache) could be up to 500MiB on a
64-bit system. This is about twice the peak during reindexing,
unnecessarily extending bitcoind's memory envelope.
This commit reduces the maximum total size of the caches used during
verification to just nCoinCacheSize, which should be the limit.
-rw-r--r-- | src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index ba521b6b19..55206600e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3052,7 +3052,7 @@ bool CVerifyDB::VerifyDB(int nCheckLevel, int nCheckDepth) } } // check level 3: check for inconsistencies during memory-only disconnect of tip blocks - if (nCheckLevel >= 3 && pindex == pindexState && (coins.GetCacheSize() + pcoinsTip->GetCacheSize()) <= 2*nCoinCacheSize + 32000) { + if (nCheckLevel >= 3 && pindex == pindexState && (coins.GetCacheSize() + pcoinsTip->GetCacheSize()) <= nCoinCacheSize) { bool fClean = true; if (!DisconnectBlock(block, state, pindex, coins, &fClean)) return error("VerifyDB() : *** irrecoverable inconsistency in block data at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString()); |