7

I have a Raspberry Pi with 925 MB of memory. Bitcoin Core, operating as a full node, uses between 600-900 MB. How can I reduce bitcoind's memory usage?

I tried setting maxmempool to its minimum allowed value, 5. What about maxreceivebuffer and maxsendbuffer? Would setting these to a low value reduce memory usage?

  • 2
    Short comment before writing a full answer: a 5 MB mempool isn't particularly useful. You might as well disable the mempool entirely with -blocksonly. – Pieter Wuille Jan 6 '17 at 0:26
  • @PieterWuille That's a good suggestion. I didn't know about that option. It probably lowers memory usage, too. In fact, this Reddit post on running a node on a 512 MB Raspberry Pi mentions using that flag, too. – Geremia Jan 6 '17 at 0:50
  • With -blocksonly you don't have any mempool at all. – Pieter Wuille Jan 10 '17 at 2:10
11

The largest consumers of memory are:

  • The memory pool (reduce with -maxmempool, or disable entirely with -blocksonly if you don't care about unconfirmed transactions).
  • The UTXO cache (reduce with -dbcache, at the cost of potentially much slower syncing).
  • The signature cache (reduce with -maxsigcachesize).

In addition, you can also reduce the maximum number of connections (-maxconnections) or the number of RPC threads (-rpcthreads).

A viable minimum configuration without mempool could be -blocksonly -dbcache=20 -maxsigcachesize=4 -maxconnections=4 -rpcthreads=1.

  • -blocksonly alone brought my node's memory footprint down to about ~700 MB. I also have -banscore set to 1, which seems to help get rid of spammy nodes that flood my node with bad transactions. – Geremia Jan 12 '17 at 15:04
  • Was still crashing with me! But setting also maxmempool=100 was causing bitcoind to be at ca. 570MB RSS, that works on my 1GB VPS. – Borph Mar 20 '17 at 8:48
  • 1
    I used the follow options: blocksonly=1 dbcache=50 maxorphantx=10 maxmempool=100 maxconnections=32 and bitcoind is running smoothly on my raspberrypi with the follow Memory footprint VSZ 422524 and RSZ 266956 – Alex Sep 4 '17 at 19:39
1

Followed your parameter: ~/bitcoin/bin/bitcoind -blocksonly=1 -dbcache=50 -maxorphantx=10 -maxmempool=100 &

only 286M memory used after bitcoind running.

  • 1
    Please don't use the "answer" box to write "thank you" type comments. Please take the tour and check this faq on deleted answers. – Max Vernon Sep 21 '18 at 19:29
  • 1
    In my opinion this answer does add a bit more new information so I don't think it needs to be deleted – MeshCollider Sep 23 '18 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.