superzhu
superzhu

Reputation: 11

What is the difference of Pooled ByteBuf and UnPooled ByteBuf

Under package io.netty.buffer, there exists many types of ByteBuf, such as PooledDirectByteBuf, PooledHeapByteBuf, UnpooledDirectByteBuf, UnpooledHeapByteBuf. Could anyone kindly explain their difference?

Upvotes: 1

Views: 1789

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23567

Pooled ByteBuf are what they name says... They are pooled which means they are not released directly but pooled so they can be reused again. This is mainly useful as allocating and deallocating of direct ByteBuf is expensive.

Upvotes: 5

Related Questions