Whats the difference between Pooled vs Unpooled and Direct vs Heap in ByteBuf?
Like , what does pooled means in context of a message received , because object like HttpRequest is created from ByteBuf in one of HttpRequestDecoder and then released in last handler of pipeline ? Whats pooled memory in this case? How memory management will differ for pooled vs unpooled ?
The difference is that with unpooled Netty will allocate a new buffer everytime you call ByteBufAllocator.buffer which comes with some overhead, especially with direct buffers. When you use pooled Netty will try to pool the buffers and so minimize the overhead of allocation and releasing of buffers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With