What is the maximum size of the memory pool?

8

1

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:

Rich Apodaca

Posted 2015-04-28T23:34:42.717

Reputation: 1 896

Answers

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.

Anonymous

Posted 2015-04-28T23:34:42.717

Reputation: 10 054

3I think the OPs concern is that an attacker could cause memory overflows just by broadcasting many many transactions.morsecoder 2015-04-29T10:21:01.890

@StephenM347, you got it. I'll update the question.Rich Apodaca 2015-04-29T22:17:18.407