This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Add a configurable memory cap for mempool#1590
Closed
congwang wants to merge 11 commits into
Closed
Conversation
Contributor
Contributor
|
Is this pr still valid? |
Contributor
|
I think it was closed because it turned out to not solve the original issue, im not sure if the commits here can still be used but likely that can. |
Contributor
Author
|
Right, the original back-pressure-related memory issue is addressed by #1785. About this PR itself, the mempool does not contribute to memory pressure, we will hit the hard limit anyway no matter we have mempool or not, the problem with mempool is that it may hit the soft limit eventually since this memory never shrinks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Currently mempool is unbounded and memory in mempool grows and settles on steady state. This causes stream manager could use a lot of memory in production. We need a mechanism to add a cap there, the memory usage of stmgr is reduced down to 10% and meanwhile performance is almost not affected at all.
Note, I use a global limit for all instances of BaseMemPool (including MemPool), this relies on the C++ type system.
This should resolve #1567