Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

isdom
Copy link
Contributor

@isdom isdom commented Jan 27, 2017

Motivation:

Disable ThreadLocal Cache, then allocate Pooled ByteBuf and release all these buffers, PoolArena's tiny/small/normal allocation count incorrect.

Modifications:

  • Calculate PoolArena's tiny/small/normal allocation one time
  • Add testAllocationCounter TestCase

Result:

Fixes #6282 .

allocateNormal(buf, reqCapacity, normCapacity);
return;
} finally {
incTinySmallNormalAllocation(normCapacity);
Copy link
Member

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@normanmaurer normanmaurer self-assigned this Jan 30, 2017
@normanmaurer normanmaurer added this to the 4.0.44.Final milestone Jan 30, 2017
@normanmaurer
Copy link
Member

@isdom thanks a lot... I squashed your commits and made a tiny change to minimize synchronized scope.

Cherry-picked into 4.1 (f10f8a3) and 4.0 (025e656)

@isdom
Copy link
Contributor Author

isdom commented Jan 30, 2017

@normanmaurer thanks for your adjustment. the code looks much better.

@isdom isdom deleted the fix_issue6282 branch January 30, 2017 12:52
@isdom isdom restored the fix_issue6282 branch January 30, 2017 12:52
@normanmaurer
Copy link
Member

@isdom no worries... thanks again for the help and the report!

@isdom isdom deleted the fix_issue6282 branch January 31, 2017 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants