-
Notifications
You must be signed in to change notification settings - Fork 965
PoolingPolicy support UnpooledDirect #4643
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
base: master
Are you sure you want to change the base?
PoolingPolicy support UnpooledDirect #4643
Conversation
| @Override | ||
| public ByteBuf buffer(int initialCapacity, int maxCapacity) { | ||
| if (poolingPolicy == PoolingPolicy.PooledDirect) { | ||
| if (poolingPolicy == PoolingPolicy.PooledDirect || poolingPolicy == PoolingPolicy.UnpooledDirect) { |
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.
PooledDirect and UnpooledDirect have the same implementation logic, so what's the point of adding this enumeration? I don't quite understand the purpose of your change.
Also, for the new types, I suggest adding testcase coverage.
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.
poolingPolicy == PoolingPolicy.PooledDirect condition in newDirectBuffer
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.
Unpooled did the same thing here
poolingPolicy == PoolingPolicy.PooledDirectcondition in newDirectBuffer
how does this reduce GC pressure in certain workloads? |
| @Override | ||
| public ByteBuf buffer(int initialCapacity, int maxCapacity) { | ||
| if (poolingPolicy == PoolingPolicy.PooledDirect) { | ||
| if (poolingPolicy == PoolingPolicy.PooledDirect || poolingPolicy == PoolingPolicy.UnpooledDirect) { |
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.
Unpooled did the same thing here
poolingPolicy == PoolingPolicy.PooledDirectcondition in newDirectBuffer
Previously, the memory allocation strategy was limited to pooled memory on the Java heap.
This update adds support for unpooled memory allocation off-heap, allowing greater flexibility in memory management and reducing GC pressure in certain workloads.