<p>There is no cap on the maximum size of the mempool, nor a janitor which cleans up transactions which are not confirming. Loss of unconfirmed transactions isn't a problem as wallets are supposed to rebroadcast transactions if they don't confirm within a reasonable time frame, so it wouldn't be unreasonable to drop them in a critical low memory situation. The limit on free transaction relay is there partly to prevent this from being an issue, it would be fairly expensive to pack the mempool with junk from a fee standpoint. </p>

CC BY-SA 3.0
2015-04-29T10:21:01.890Z
I think the OPs concern is that an attacker could cause memory overflows just by broadcasting many many transactions.
morsecoder
CC BY-SA 3.0
2015-04-29T22:17:18.407Z
@StephenM347, you got it. I'll update the question.
Rich Apodaca
CC BY-SA 3.0
2015-04-29T02:42:10.247Z
2015-04-29T23:38:22.887Z
2015-04-29T23:38:22.887Z
Claris
<p>The memory pool holds unconfirmed transactions in RAM. It seems that memory pool storage could overflow if no block is solved for a very long time and many transactions are published within a short interval.</p>

<p>In browsing the source code, I found no mention of a cap on the memory pool size:</p>

<p><a href="https://github.com/bitcoin/bitcoin/blob/v0.10.1/src/main.cpp#L934" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/v0.10.1/src/main.cpp#L934</a></p>

<p>Does such a cap exist? If not, couldn't an attacker use the unbounded size of the memory pool to overflow the RAM of a large number of nodes, knocking them offline?</p>

<p>I noticed two proposals that seemed to address this issue, but neither has made it through the approval process:</p>

<ul>
<li><a href="https://github.com/bitcoin/bitcoin/issues/3723" rel="nofollow">Mempool Superblock</a></li>
<li><a href="https://github.com/bitcoin/bitcoin/pull/3753" rel="nofollow">Mempool Janitor</a></li>
</ul>

<mempool>
What is the maximum size of the memory pool?
Rich Apodaca
# What is the maximum size of the memory pool?

(Asked by: username_0 on 2015-04-28)

The memory pool holds unconfirmed transactions in RAM. It seems that memory pool storage could overflow if no block is solved for a very long time and many transactions are published within a short interval.

In browsing the source code, I found no mention of a cap on the memory pool size:

<https://github.com/bitcoin/bitcoin/blob/v0.10.1/src/main.cpp#L934>

Does such a cap exist? If not, couldn't an attacker use the unbounded size of the memory pool to overflow the RAM of a large number of nodes, knocking them offline?

I noticed two proposals that seemed to address this issue, but neither has made it through the approval process:

* [Mempool Superblock](https://github.com/bitcoin/bitcoin/issues/3723)
* [Mempool Janitor](https://github.com/bitcoin/bitcoin/pull/3753)

**Tags:** mempool


---

## 1 answers

### Answer by username_1 on 2015-04-29. Score: 6

There is no cap on the maximum size of the mempool, nor a janitor which cleans up transactions which are not confirming. Loss of unconfirmed transactions isn't a problem as wallets are supposed to rebroadcast transactions if they don't confirm within a reasonable time frame, so it wouldn't be unreasonable to drop them in a critical low memory situation. The limit on free transaction relay is there partly to prevent this from being an issue, it would be fairly expensive to pack the mempool with junk from a fee standpoint.

> **Comments:**
> **username_2**: I think the OPs concern is that an attacker could cause memory overflows just by broadcasting many many transactions.  
> **username_0**: @StephenM347, you got it. I'll update the question.  

---

