Question

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 ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top