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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top