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
fix #6282: calculate correct count for PoolArena's tiny/small/normal allocation #6288
Conversation
allocateNormal(buf, reqCapacity, normCapacity); | ||
return; | ||
} finally { | ||
incTinySmallNormalAllocation(normCapacity); |
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.
@isdom I would prefer if we not need to acquire the synchronized(this)
two times when we increment for normal allocations. Can you please refactor to ensure we not do ?
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.
OK
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.
@normanmaurer Could you give me some advice for my commit: acquire the synchronized(this) once when we increment for normal allocations?
@normanmaurer thanks for your adjustment. the code looks much better. |
@isdom no worries... thanks again for the help and the report! |
Motivation:
Disable ThreadLocal Cache, then allocate Pooled ByteBuf and release all these buffers, PoolArena's tiny/small/normal allocation count incorrect.
Modifications:
Result:
Fixes #6282 .