From 5befbed4bc4f074a799ec413f595eb21f6cf06c2 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 31 Mar 2017 10:25:39 -0400 Subject: [PATCH 1/3] Fixes #2793. Backport commit f33afd3 to increase dbcache default. --- src/txdb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/txdb.h b/src/txdb.h index a2764b8c2..04ac8627b 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -20,8 +20,8 @@ struct CDiskTxPos; class uint256; //! -dbcache default (MiB) -static const int64_t nDefaultDbCache = 100; -//! max. -dbcache in (MiB) +static const int64_t nDefaultDbCache = 450; +//! max. -dbcache (MiB) static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 16384 : 1024; //! min. -dbcache in (MiB) static const int64_t nMinDbCache = 4; From 334d591377896421e356dfbfb57c8f9022970cf3 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 17 Jan 2018 16:55:26 -0800 Subject: [PATCH 2/3] Add documentation about dbcache. Adapted from documentation 'Reducing bitcoind memory usage' by @laanwj https://gist.github.com/laanwj/efe29c7661ce9b6620a7 --- doc/reducing-memory-usage.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/reducing-memory-usage.md diff --git a/doc/reducing-memory-usage.md b/doc/reducing-memory-usage.md new file mode 100644 index 000000000..333ea0086 --- /dev/null +++ b/doc/reducing-memory-usage.md @@ -0,0 +1,8 @@ +In-memory caches +---------------- + +The size of some in-memory caches can be reduced. As caches trade off memory usage for performance, usually reducing these have a negative effect on performance. + +- `-dbcache=` - the UTXO database cache size, this defaults to `450` (`100` before 1.0.15). The unit is MiB (where 1 GiB = 1024 MiB). + - The minimum value for `-dbcache` is 4. + - A lower dbcache make initial sync time much longer. After the initial sync, the effect is less pronounced for most use-cases, unless fast validation of blocks is important such as for mining. From d2b77b7afa4b0015c4bffe554a76d8da5a1a93ce Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 19 Jan 2018 16:52:25 -0800 Subject: [PATCH 3/3] Add note about dbcache to 1.0.15 release notes. Adapted from upstream release notes here: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.14.1.md#utxo-memory-accounting --- doc/release-notes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index a29094b51..7355bcfc6 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -4,3 +4,9 @@ release-notes at release time) Notable changes =============== +UTXO memory accounting +---------------------- + +The default -dbcache has been changed in this release to 450MiB. Users can set -dbcache to a higher value (e.g. to keep the UTXO set more fully cached in memory). Users on low-memory systems (such as systems with 1GB or less) should consider specifying a lower value for this parameter. + +Additional information relating to running on low-memory systems can be found here: [reducing-memory-usage.md](https://github.com/zcash/zcash/blob/master/doc/reducing-memory-usage.md).