Bad allocation in Raspberry Pi #9434

issue Frederic94500 opened this issue on December 27, 2016
  1. Frederic94500 commented at 12:06 AM on December 27, 2016: none

    Hello!

    I run a full node in a Raspberry Pi 3 (OS: Raspbian (lastest)) with 1 To of Hard Drive where the blockchain is stocked and then, I have this error:

    EXCEPTION: St9bad_alloc
    std::bad_alloc
    bitcoin in ProcessMessages()

    I don't know what is this and after this error, I have a lot of errors!

    http://pastebin.com/m572ySGj

    After this, the blockchain is corrupted!

    PS: My English is not very good, sorry!

  2. fanquake added the label Linux/Unix on Dec 27, 2016
  3. fanquake commented at 12:09 AM on December 27, 2016: member

    It looks like you are running out of memory. How much do you have available?

  4. Frederic94500 commented at 12:10 AM on December 27, 2016: none

    @fanquake It's a Raspberry Pi 3 so 1 Gb of RAM

  5. Frederic94500 commented at 12:12 AM on December 27, 2016: none

    Oh I forgot a thing, the node was run during almost a day

  6. jonasschnelli commented at 9:20 AM on December 27, 2016: contributor

    Your node ran out of ram. Can you post your bitcoin.conf or the startup arguments you have provided? Try to reduce memory consumption.-dbcache=100 and -maxmempool=100 maybe.

    Also, have a look at the ram consumption of other apps on your RPI.

  7. Frederic94500 commented at 12:51 PM on December 27, 2016: none

    I don't have bitcoin.conf, but the configuration is in one command:

    ./bitcoind -server -rpcuser=pi -rpcpassword=XXXXXX -disablewallet -datadir=/media/pi/9E56F5CB56F5A3E5/Bitcoin -addnode=192.168.0.12 -listen -timeout=10000

    I think it's the maxmempool. What is the best configuration for RPI?

  8. jonasschnelli commented at 1:41 PM on December 27, 2016: contributor

    What is the best configuration for RPI?

    Depends on your use-case. If you want to estimate fees (run a wallet or something similar), you shouldn't set it to low. Maybe 100MB is enough. If you don't need 0-conf and a mempool, try the -blocksonly mode.

  9. Frederic94500 commented at 2:03 PM on December 27, 2016: none

    @jonasschnelli I want a full node to support Core. I don't know if this config is good.

    ./bitcoind -server -rpcuser=pi -rpcpassword=XXXXXX -disablewallet -datadir=/media/pi/9E56F5CB56F5A3E5/Bitcoin -addnode=192.168.0.12 -listen -timeout=10000 -maxmempool=75 -maxconnections=150

  10. jonasschnelli commented at 2:47 PM on December 27, 2016: contributor

    Whats the reason for the -addnode=192.168.0.12 (do you have a local node running there?). -maxconnections=150 can also be a thing to reduce RAM. 125 is default. Maybe go down to 32 if you have further out-of-memory issues.

  11. Frederic94500 commented at 2:58 PM on December 27, 2016: none

    Ah -addnode=192.168.0.12 it's for fun ^^ Maybe for -maxconnections, I try with 50 and for -timeout, I try with 7500

  12. unsystemizer commented at 6:36 PM on December 27, 2016: contributor

    Just search Google for recommended options for Pi, there are hundreds of examples of working configs. Some can probably be found here in Issues. This isn't a unique situation or setup. The simplest approach for Pi is to set everything to minimum, rather than decrease the values until the daemon stops crashing. Five connections work just as fine as 50.

  13. Frederic94500 commented at 9:23 PM on December 29, 2016: none

    Alright! The node is running since 1-2 days ^^ It's just to add some swap space

  14. Frederic94500 closed this on Dec 29, 2016

  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me