EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.6k forks source link

nodeos crashed upon filter Reason :bad alloc #4050

Closed ZebPayDhruvil closed 6 years ago

ZebPayDhruvil commented 6 years ago

Jungle testnet is being synced on a 16 GB vm Looks like a memory issue, nodeos used 100% CPU too while replaying

$NODEOSBINDIR/nodeos --max-irreversible-block-age 108000 --filter-on "eosio.token:transfer:" --data-dir $DATADIR --config-dir $DATADIR --replay

1507495ms thread-0 chain_plugin.cpp:200 plugin_initialize ] initializing chain plugin 1507496ms thread-0 chain_plugin.cpp:306 plugin_initialize ] Replay requested: deleting state database 1507629ms thread-0 block_log.cpp:123 open ] Log is nonempty 1507629ms thread-0 block_log.cpp:136 open ] my->head->block_num(): 326878 1507629ms thread-0 block_log.cpp:142 open ] Index is nonempty 1507639ms thread-0 http_plugin.cpp:285 plugin_initialize ] configured http to listen on 0.0.0.0:8888 1507639ms thread-0 net_plugin.cpp:2815 plugin_initialize ] Initialize net plugin 1507639ms thread-0 net_plugin.cpp:2836 plugin_initialize ] host: 0.0.0.0 port: 9876 1507640ms thread-0 net_plugin.cpp:2908 plugin_initialize ] my node_id is 31859bd2211d897d0b15fc8c9b4ba085e5ee97371523b88dd765fcead1e93481 1507640ms thread-0 http_plugin.cpp:251 operator() ] configured http with Access-Control-Allow-Origin: * 1507640ms thread-0 main.cpp:104 main ] nodeos version 0961a560 1507640ms thread-0 main.cpp:105 main ] eosio root is /home/ubuntu/.local/share 1507640ms thread-0 controller.cpp:1142 startup ] No head block in fork db, perhaps we need to replay 1507640ms thread-0 controller.cpp:307 initialize_fork_db ] Initializing new blockchain with genesis state
1507676ms thread-0 controller.cpp:199 init ] existing block log, attempting to replay 326878 blocks 2389330ms thread-0 controller.cpp:147 emit ] bad alloc 2389330ms thread-0 fork_database.cpp:93 close ] num_blocks_in_fork_db: 2 2389330ms thread-0 controller.cpp:261 ~controller_impl ] db.revision(): 22266 head->block_num: 22266 blog.read_head()->block_num(): 326878 2400343ms thread-0 main.cpp:116 main ] bad alloc

config.ini

log-level-net-plugin = info
max-clients = 120
connection-cleanup-period = 30
network-version-match = 1
sync-fetch-span = 2000
enable-stale-production = false
required-participation = 33

mongodb-queue-size = 256
# mongodb-uri =

# peer-key =
# peer-private-key =

plugin = eosio::producer_plugin
plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::history_plugin
plugin = eosio::history_api_plugin
wanderingbort commented 6 years ago

The eosio::history_plugin will consume a large amount of state storage space on any active chain if you filter-on the eosio.token transfer action.

By default the amount of RAM a node can use to store state is 1 GiB and can be controlled with the chain-state-db-size-mb option which is specified in MiB

This error means you exhausted that storage and in order to proceed, you will need to set a higher value or a tighter filter.

Once the mongodb plugin #3030 is re-enabled that may be a better option for storing lots of historical transaction data as it does not colocate the history data and the contract state in the critical shared memory file.