Title: unable to allocate memory for mutex; resize mutex region/EXCEPTION:11DbException Post by: tytus on May 09, 2012, 02:50:02 PM I am trying to start bitcoind on various debian machines. The blockchain loading stops at a consistent location with a db error:
tytus@home:~/.bitcoin$ ~/.bitcoin/bitcoind getinfo { "version" : 60006, "protocolversion" : 60000, "walletversion" : 60000, "balance" : 0.00000000, "blocks" : 156638, "connections" : 8, "proxy" : "", "difficulty" : 1090715.68005127, "testnet" : false, "keypoololdest" : 1336563519, "keypoolsize" : 101, "paytxfee" : 0.00000000, "errors" : "EXCEPTION: 11DbException \nDb::put: Cannot allocate memory \nbitcoin in ProcessMessage() \n" } tytus@home:~/.bitcoin$ head db.log unable to allocate memory for mutex; resize mutex region It looks like a db4.8 problem. I have tried the latest binaries and a self compiled version. My ulimits are: tytus@home:~/.bitcoin$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 16382 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) 2097152 file locks (-x) unlimited I have searched for answers on the web and found only this transcript: http://bitcoinstats.com/irc/bitcoin-dev/logs/2011/08/11 but without a solution. Maybe by manually adding a DB_CONFIG file in ~/.bitcoin I can solve this but there must be an official solution. Can anybody help? Title: Re: unable to allocate memory for mutex; resize mutex region/EXCEPTION:11DbException Post by: Stephen Gornick on May 09, 2012, 07:13:45 PM Sorry, just read that you wrote "tried latest binaries" Are you using the same blockchain db files on each attempt? If so, does a new blockchain data file resolve it? If so, delete and download a secure, full blockchain again. A nightly of the blockchain data (and other sources) is: - http://bitcoin.stackexchange.com/a/3552/153 Title: Re: unable to allocate memory for mutex; resize mutex region/EXCEPTION:11DbException Post by: tytus on May 09, 2012, 10:03:59 PM I found a solution
I increased the mutex region by adding a DB_CONFIG file ___@___:~/.bitcoin$ cat DB_CONFIG mutex_set_max 100000 The region went from 2MB to 12MB ... this is for suer too much. Setting mutex_set_max to 32k should be sufficient. To test the current utilization on a running bitcoind: ___@___:~/.bitcoin$ db4.8_stat -x 12MB 1000KB Mutex region size 0 The number of region locks that required waiting (0%) 4 Mutex alignment 100 Mutex test-and-set spins 100000 Mutex total count 77212 Mutex free count 22788 Mutex in-use count 22789 Mutex maximum in-use count Mutex counts 77212 Unallocated 3 db handle 1 env dblist 2 env handle 1 env region 23 lock region 3668 logical lock 1 log filename 1 log flush 2 log region 3 mpoolfile handle 14955 mpool buffer 3 mpool filehandle 17 mpool file bucket 1 mpool handle 4099 mpool hash bucket 1 mpool region 1 mutex region 1 twister 1 txn active list 1 transaction checkpoint 2 txn commit 1 txn region |