Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netty 4 Buffers pooled vs unpooled

Tags:

netty

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 ?

like image 838
user1920845 Avatar asked Apr 03 '14 15:04

user1920845


1 Answers

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.

like image 122
Norman Maurer Avatar answered Nov 12 '22 05:11

Norman Maurer