This should enhance the default performance characteristics by reusing
ByteBufs if possible. With 4.0.19, netty keeps a thread-local cache of
direct buffers, so we should see a reduction in buffer copying, if not
other effects.
Change-Id: I81fcf380f6f3b03187000dbca0dd8507975e8dd1
Signed-off-by: Robert Varga <rovarga@cisco.com>
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
+import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
// makes no sense for LocalServer and produces warning
b.childOption(ChannelOption.SO_KEEPALIVE, true);
}
+ b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
customizeBootstrap(b);
if (b.group() == null) {