Bitcoin Forum
May 08, 2024, 11:18:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: unable to allocate memory for mutex; resize mutex region/EXCEPTION:11DbException  (Read 3541 times)
tytus (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 250


View Profile
May 09, 2012, 02:50:02 PM
 #1

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?
1715210326
Hero Member
*
Offline Offline

Posts: 1715210326

View Profile Personal Message (Offline)

Ignore
1715210326
Reply with quote  #2

1715210326
Report to moderator
1715210326
Hero Member
*
Offline Offline

Posts: 1715210326

View Profile Personal Message (Offline)

Ignore
1715210326
Reply with quote  #2

1715210326
Report to moderator
1715210326
Hero Member
*
Offline Offline

Posts: 1715210326

View Profile Personal Message (Offline)

Ignore
1715210326
Reply with quote  #2

1715210326
Report to moderator
"Bitcoin: the cutting edge of begging technology." -- Giraffe.BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715210326
Hero Member
*
Offline Offline

Posts: 1715210326

View Profile Personal Message (Offline)

Ignore
1715210326
Reply with quote  #2

1715210326
Report to moderator
1715210326
Hero Member
*
Offline Offline

Posts: 1715210326

View Profile Personal Message (Offline)

Ignore
1715210326
Reply with quote  #2

1715210326
Report to moderator
1715210326
Hero Member
*
Offline Offline

Posts: 1715210326

View Profile Personal Message (Offline)

Ignore
1715210326
Reply with quote  #2

1715210326
Report to moderator
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
May 09, 2012, 07:13:45 PM
 #2

Are you using a recent release (e.g., v0.6.2 ?)

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

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


tytus (OP)
Sr. Member
****
Offline Offline

Activity: 250
Merit: 250


View Profile
May 09, 2012, 10:03:59 PM
 #3

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!