码迷,mamicode.com
首页 > Web开发 > 详细

netty pooled vs unpooled ByteBuf

时间:2019-10-12 20:49:29      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:ast   locate   dir   handler   this   new   heap   mini   because   

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.

netty pooled vs unpooled ByteBuf

标签:ast   locate   dir   handler   this   new   heap   mini   because   

原文地址:https://www.cnblogs.com/CreatorKou/p/11663610.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!