bitcoin icon indicating copy to clipboard operation
bitcoin copied to clipboard

memusage: let PoolResource keep track of all allocated/deallocated memory

Open martinus opened this issue 2 years ago • 3 comments

We recently (in #28906) had OOM problems due to incorrect memory usage estimation. When PoolResource is used the estimation can be brittle because when implementing memusage estimation for a container it is not obvious when the pool can be used.

As suggested here https://github.com/bitcoin/bitcoin/issues/28906#issuecomment-1817885270, to prevent these problems in future we can simply let the PoolResource do all the accounting. Then the memory usage estimation is always accurate, even when the pool's memory chunks cannot be used.

martinus avatar Nov 25 '23 18:11 martinus

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK hebasto, jonatack

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28531 (improve MallocUsage() accuracy by LarryRuane)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

DrahtBot avatar Nov 25 '23 18:11 DrahtBot

Concept ACK.

hebasto avatar Nov 25 '23 18:11 hebasto

Could rebase for fresh CI?

DrahtBot avatar Apr 17 '24 18:04 DrahtBot