New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop trimming when mapTx is empty #8220

Merged
merged 1 commit into from Jun 20, 2016

Conversation

Projects
None yet
7 participants
@sipa
Member

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

This comment has been minimized.

Show comment
Hide comment
@pstratem

pstratem Jun 18, 2016

Contributor

@sipa ie sizelimit < overhead of zero transactions ?

Contributor

pstratem commented Jun 18, 2016

@sipa ie sizelimit < overhead of zero transactions ?

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Jun 18, 2016

Member

@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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Jun 18, 2016

Member

utACK.

Member

gmaxwell commented Jun 18, 2016

utACK.

@pstratem

This comment has been minimized.

Show comment
Hide comment
@pstratem

pstratem Jun 18, 2016

Contributor

utACK ad0752e

Contributor

pstratem commented Jun 18, 2016

utACK ad0752e

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Jun 18, 2016

Contributor

utACK ad0752e

Contributor

paveljanik commented Jun 18, 2016

utACK ad0752e

@pstratem

This comment has been minimized.

Show comment
Hide comment
@pstratem

pstratem Jun 18, 2016

Contributor

ACK ad0752e

Contributor

pstratem commented Jun 18, 2016

ACK ad0752e

@TheBlueMatt TheBlueMatt referenced this pull request Jun 19, 2016

Merged

Compact Blocks #8068

@dcousens

This comment has been minimized.

Show comment
Hide comment
@dcousens

dcousens Jun 19, 2016

Contributor

utACK ad0752e

Contributor

dcousens commented Jun 19, 2016

utACK ad0752e

@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Jun 19, 2016

Member

ACK ad0752e (upgrade from prior utack)

Member

gmaxwell commented Jun 19, 2016

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

Merge #8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)

codablock added a commit to codablock/dash that referenced this pull request Sep 16, 2017

Merge bitcoin#8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)

codablock added a commit to codablock/dash that referenced this pull request Sep 19, 2017

Merge bitcoin#8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)

codablock added a commit to codablock/dash that referenced this pull request Dec 27, 2017

Merge bitcoin#8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)

codablock added a commit to codablock/dash that referenced this pull request Dec 28, 2017

Merge bitcoin#8220: Stop trimming when mapTx is empty
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment