Thursday, January 15, 2026

bitcoin core – What’s saved in dbcache and with what precedence?

Solely deserialized UTXOs are held within the dbcache. Deserialized UTXOs are bigger than the serialized illustration on disk, so even whereas the chainstate is just 11 GB, it might be bigger in reminiscence.

The -maxmempool configuration parameter limits the quantity of reminiscence utilized by the mempool in MB. Unused mempool reminiscence is used as extra dbcache.

Outdated blocks are solely saved on disk, they don’t seem to be cached.

That stated, there may be a misunderstanding right here:
The UTXO set is primarily saved on disk. When a node processes unconfirmed or confirmed transactions, it can load all the mandatory UTXOs for inputs from disk into the cache. When a brand new block is processed, it can additionally cache any outputs created by the confirmed transactions within the block.

The UTXO cache acts as a write-buffer. The UTXO set adjustments are saved in reminiscence till the dbcache is full after which the whole cache is flushed to disk (emptying the cache). If a UTXO is created and spent earlier than the cache is flushed, it’s by no means written to disk. The UTXO state can also be synchronized to disk as soon as per day (as soon as per hour throughout IBD) even when the dbcache will not be full. Then solely the soiled entries are written to disk and the remaining cache is saved heat (not emptying the cache).

Nodes don’t reload the whole UTXO cache when beginning. UTXOs solely get cached as a result of transactions being validated, so besides proper after IBD with a really giant dbcachea node will usually by no means maintain the whole UTXO set in reminiscence. The node will nonetheless solely allocate as a lot reminiscence because it makes use of, so a bigger than vital dbcache won’t waste reminiscence. A bigger dbcache is predominantly helpful throughout IBD, and it’s not vital for the dbcache to be giant sufficient to carry the whole UTXO set. Since a node additionally wants reminiscence for the working system and different packages, the dbcache setting shouldn’t be set larger than 75% of the node’s obtainable reminiscence.

I assume that every one of this would be the similar for Knots, however I’m not accustomed to that code base.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles