Skip to content

Conversation

sipa
Copy link
Member

@sipa sipa commented Jun 18, 2016

When CTxMemPool::TrimToSize is called with a very low number (like somewhere in mempool_tests), it is possible that the memory usage never sinks below the specified number.

This is unlikely to be a problem right now, but will be with the introduction of CTxMemPool::vTxHashes in #8068.

@pstratem
Copy link
Contributor

@sipa ie sizelimit < overhead of zero transactions ?

@sipa
Copy link
Member Author

sipa commented Jun 18, 2016

@pstratem Yes, given that there are various support data structures in the mempool whose size is hard to scale linearly with the number of transactions, this seems like a reasonable solution. There are certainly others (like requiring the trim size to be at least a multiple of a transaction + overhead), but this is so simple and probably something that should have been there as a safeguard from the start.

@gmaxwell
Copy link
Contributor

utACK.

@pstratem
Copy link
Contributor

utACK ad0752e

@paveljanik
Copy link
Contributor

utACK ad0752e

@pstratem
Copy link
Contributor

ACK ad0752e

@TheBlueMatt TheBlueMatt mentioned this pull request Jun 19, 2016
@dcousens
Copy link
Contributor

utACK ad0752e

@gmaxwell
Copy link
Contributor

ACK ad0752e (upgrade from prior utack)

@laanwj laanwj merged commit ad0752e into bitcoin:master Jun 20, 2016
laanwj added a commit that referenced this pull request Jun 20, 2016
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
codablock pushed a commit to codablock/dash that referenced this pull request Dec 28, 2017
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants