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.
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.
poolingPolicy == PoolingPolicy.PooledDirect condition in newDirectBuffer
There was a problem hiding this comment.
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.
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.