4

I compiled bitcoind using the same steps as last year. In particular I set DB_CONFIG:

set_lg_dir database
set_lk_max_locks 537000

Unfortunately once I hit block 364,670 (2015-07-10) I'm treated with:

EXCEPTION: 11DbException
Db::put: Cannot allocate memory
bitcoin in ProcessMessage()

I tried raising set_lk_max_locks to 1000000 but that didn't help. This happens immediately when restarting the node, so it doensn't seem to be a RAM issue.

The ~/.bitcoin/database looks rather large, assuming this is the equivalent of todays ~/.bitcoin/chainstate and ``~/.bitcoin/blocks/index`.

$ du -s ~/.bitcoin
92047404 # 88 GB
$ du -s ~/.bitcoin/database
42169668 # 41 GB

How can I get the synchronization to continue?

4
  • 1
    Hey Sjors, I sense a possible implicit question such as "What can I do to make the sync continue?", but could you actually add a phrase what you exactly are looking for in an answer to your post? :)
    – Murch
    Nov 29, 2018 at 16:41
  • I used the exact same wording as last year :-) Added "- what to do?" to the question. The goal is to get it unstuck. Nov 30, 2018 at 13:04
  • Were you able to resolve this to continue the download?
    – LeanMan
    Jun 19, 2020 at 2:39
  • 1
    @LeanMan no, but I believe Andrew Chow is trying at the moment (see his answer below). Mar 23, 2022 at 13:54

1 Answer 1

4

According to BDB's documentation, there's actually 4 options controlling parameters in the locking subsystem:

  • set_lk_max_locks
  • set_lk_max_lockers
  • set_lk_max_objects
  • set_lk_partitions

From my understanding of the documentation, max_lockers and partitions are not really relevant for Bitcoin as there is not a whole lot of concurrent access to the database, which is what those parameters control.

However, if you look at the db.log file, there are entries when the failures occur that point to which parameters need to be increased.

On 0.5.0, the first error I ran into was Lock table is out of available lock entries. This indicates that set_lk_max_locks needs to be increased, and indeed, increasing it does get past the problem block.

The second error was Lock table is out of available object entries, and this I believe is the error you have run into here. This indicates that set_lk_max_objects needs to be increased. So this problem can be resolved by doing e.g. set_lk_max_objects 1000000, until you run out of locks or lock objects again, or some other problem comes up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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