-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Go back to the previous ABBP algo and fix it #11428
Go back to the previous ABBP algo and fix it #11428
Conversation
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
long total = 0L; | ||
for (RetainedBucket bucket : buckets) | ||
{ | ||
total += bucket._pool.size() * (long)bucket._capacity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this number is? It is all idle and inuse buffers from any concurrent pool plus just the idle buffers from any queued pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the known memory consumption, which doesn't mean much.
long maxMemory = direct ? _maxDirectMemory : _maxHeapMemory; | ||
if (maxMemory > 0) | ||
{ | ||
long excess = getMemory(direct) - maxMemory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a full iteration over buckets with a full iteration over each concurrent pool entry for every pool miss. This is not different to my PRs always checking memory in the retain method.
However, you do not check max memory for a normal release, and it certainly can be exceeded (especially with the strange impl of getMemory).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worse than your impl, and the memory accounting is quite strange indeed.
…y-limited fast path test actually hit the limit Signed-off-by: Ludovic Orban <lorban@bitronix.be>
I'm not convinced this implementation is better than #11426 as when it reaches memory capacity, very many acquisitions won't be served and will trigger an eviction, making the performance plummet quite badly. Here's what the microbenchmark has to say about this:
|
It was worth doing for comparison, but the alternative in #11426 is better. |
Alternative to #11426