<p>Bitcoind uses a lot of virtual memory, due to having multiple threads, and maintaining several node-wide and per-peer caches of data (UTXO cache, mempool, relay cache, network buffers, known invs list, ...). </p>

<p>Until recently, many of these were effectively unbounded, depending on network conditions. The upcoming release of Bitcoin Core 0.12 has far better internal memory accounting, UTXO set limiting, mempool limiting, and more compact internal representations.</p>

CC BY-SA 4.0
2022-10-09T13:30:52.300Z
Core v0.23 on debian fully synced,pruned uses 4.2GB virtual mem and 250MB real mem, that's a huge overhead. progress=1.000000 cache=65.1MiB(438170txo)
Vincent Alex
CC BY-SA 3.0
2016-02-11T14:51:05.880Z
2016-02-11T14:51:05.880Z
Pieter Wuille
<p>The bitcoin version 0.11.1 (linux 32 bit)  seems to deal better with the memory, so i amnot having the problem anymore</p>

CC BY-SA 3.0
2015-11-25T03:07:05.970Z
2015-11-25T03:07:05.970Z
Cahoiner
<p>A bitcoind restart helps. The memory consumption grows over time, after a restart it will start growing again but you have some weeks of operation to go. memory growth rate depends on what is going on the bitcoin network. </p>

CC BY-SA 3.0
2015-10-24T10:08:54.960Z
2015-10-24T10:08:54.960Z
Cahoiner
<p>My wallet.dat is 260MB big. I am using 32bit bitcoind (bitcoin-0.10.2), linux. </p>

<p>Bitcoind is having memory problems:</p>

<pre><code> ["errors"]=&gt;
  string(89) "EXCEPTION: St9bad_alloc       
std::bad_alloc       
bitcoin in ProcessMessages()       
</code></pre>

<p>Current memory allocation:
  2.9 GB virt, 2.3 GB virt.</p>

<p>How can I resolve the memory problem? Can I delete old unused addresses?
I did not find an API call to remove old addresses.
Probably bitcoin-0.11.0 does not resolve the problem either, it has already nearly same values: 2.45 GB Virt, 2.1 GB Res.</p>

CC BY-SA 3.0
2015-10-15T17:08:15.267Z
Why's your wallet.dat so big? Are you automatically generating addresses?
Nick ODell
CC BY-SA 3.0
2015-10-15T17:12:28.827Z
No i try to reduce the amount of newly generated addresses meanwhile. But this strategy does not help me because it is already too big. I want to reduce it, please help how can i do it?
Cahoiner
CC BY-SA 3.0
2015-10-15T19:19:36.153Z
Is there a light weight implementation which can load the wallet.dat from the bitcoind?
Cahoiner
CC BY-SA 3.0
2015-10-15T19:59:59.567Z
Are you certain that the size of wallet.dat is the cause of the problem?  If you stop bitcoind, move wallet.dat out of the .bitcoin directory, and start bitcoind again, does it use much less memory? By the way, you can temporarily get it working (although perhaps slowly) by adding swap.
Nate Eldredge
CC BY-SA 3.0
2015-10-15T20:02:10.537Z
There is no built-in way to delete addresses as far as I know - probably this was considered too dangerous.  Roughly how many of the addresses in the wallet do you need to save?
Nate Eldredge
CC BY-SA 3.0
2015-10-15T20:39:23.907Z
Hi there,SWAP does not help, the limit is under 32bit processes 4GB ram minus few MBs. Yes wallet.dat is the problem, without wallet.dat the process is using less than1 GB virt. As it sounds i need to create a new wallet.dat and import from the old one. And by this discarding unused addresses. But the transfer progress will be error prone. Sounds like huge problem, dam.
Cahoiner
CC BY-SA 3.0
2015-10-16T04:31:01.837Z
Now after a restart with bitcoin-0.11.0 only 900M virt is used. Is it possible that someone attacked my wallet? I have read up with in memory transactions or something ... .  Actually i saw many wallet conflicts warning
Cahoiner
CC BY-SA 3.0
2015-10-16T08:07:37.283Z
Is your wallet.dat is so big because of many privkeys/addresses or because of large number of transactions with them? These are two different problems. Each of them has own solution.
amaclin
CC BY-SA 3.0
2015-10-16T17:13:18.617Z
dont know whats taking more memory, addresses or transactions. Addresses are about 150k addresses, the rest must be transactions. currently process is taking 1150MB virt, so it must be temporary data which has filled up the memory. because the 4GB virt limit was reached before restarting bitcoind
Cahoiner
CC BY-SA 3.0
2015-12-13T10:48:42.890Z
Did not have the problem anymore with bitcoind version bitcoin-0.11.2. Maybe it has been resolved
Cahoiner
<bitcoind><memory>
Running out of memory, how can I reduce the size of wallet.dat?
Cahoiner
# Running out of memory, how can I reduce the size of wallet.dat?

(Asked by: username_0 on 2015-10-15)

My wallet.dat is 260MB big. I am using 32bit bitcoind (bitcoin-0.10.2), linux.

Bitcoind is having memory problems:

```
 ["errors"]=>
  string(89) "EXCEPTION: St9bad_alloc       
std::bad_alloc       
bitcoin in ProcessMessages()       

```

Current memory allocation:
2.9 GB virt, 2.3 GB virt.

How can I resolve the memory problem? Can I delete old unused addresses?
I did not find an API call to remove old addresses.
Probably bitcoin-0.11.0 does not resolve the problem either, it has already nearly same values: 2.45 GB Virt, 2.1 GB Res.

**Tags:** bitcoind, memory

> **Comments:**
> **username_1**: Why's your wallet.dat so big? Are you automatically generating addresses?  
> **username_0**: No i try to reduce the amount of newly generated addresses meanwhile. But this strategy does not help me because it is already too big. I want to reduce it, please help how can i do it?  
> **username_0**: Is there a light weight implementation which can load the wallet.dat from the bitcoind?  
> **username_2**: Are you certain that the size of wallet.dat is the cause of the problem?  If you stop bitcoind, move wallet.dat out of the .bitcoin directory, and start bitcoind again, does it use much less memory? By the way, you can temporarily get it working (although perhaps slowly) by adding swap.  
> **username_2**: There is no built-in way to delete addresses as far as I know - probably this was considered too dangerous.  Roughly how many of the addresses in the wallet do you need to save?  
> **username_0**: Hi there,SWAP does not help, the limit is under 32bit processes 4GB ram minus few MBs. Yes wallet.dat is the problem, without wallet.dat the process is using less than1 GB virt. As it sounds i need to create a new wallet.dat and import from the old one. And by this discarding unused addresses. But the transfer progress will be error prone. Sounds like huge problem, dam.  
> **username_0**: Now after a restart with bitcoin-0.11.0 only 900M virt is used. Is it possible that someone attacked my wallet? I have read up with in memory transactions or something ... .  Actually i saw many wallet conflicts warning  
> **username_3**: Is your wallet.dat is so big because of many privkeys/addresses or because of large number of transactions with them? These are two different problems. Each of them has own solution.  
> **username_0**: dont know whats taking more memory, addresses or transactions. Addresses are about 150k addresses, the rest must be transactions. currently process is taking 1150MB virt, so it must be temporary data which has filled up the memory. because the 4GB virt limit was reached before restarting bitcoind  
> **username_0**: Did not have the problem anymore with bitcoind version bitcoin-0.11.2. Maybe it has been resolved  

---

## 3 answers

### Answer by username_4 on 2016-02-11. Score: 1

Bitcoind uses a lot of virtual memory, due to having multiple threads, and maintaining several node-wide and per-peer caches of data (UTXO cache, mempool, relay cache, network buffers, known invs list, ...).

Until recently, many of these were effectively unbounded, depending on network conditions. The upcoming release of Bitcoin Core 0.12 has far better internal memory accounting, UTXO set limiting, mempool limiting, and more compact internal representations.

> **Comments:**
> **username_5**: Core v0.23 on debian fully synced,pruned uses 4.2GB virtual mem and 250MB real mem, that's a huge overhead. progress=1.000000 cache=65.1MiB(438170txo)  

---

### Answer by username_0 on 2015-11-25. Score: 0

The bitcoin version 0.11.1 (linux 32 bit) seems to deal better with the memory, so i amnot having the problem anymore


---

### Answer by username_0 on 2015-10-24. Score: -1

A bitcoind restart helps. The memory consumption grows over time, after a restart it will start growing again but you have some weeks of operation to go. memory growth rate depends on what is going on the bitcoin network.


---

