Top Description Interfaces Classes
module io.netty5.buffer

Package io.netty5.buffer.pool


A pooling io.netty5.buffer.BufferAllocator implementation based on jemalloc.

Interface Summary

Modifier and TypeInterface and Description
public interface
public interface
public interface
PoolArenaMetric

Expose metrics for an arena.

public interface
PoolChunkListMetric

Metrics for a list of chunks.

public interface
PoolChunkMetric

Metrics for a chunk.

public interface
PoolSubpageMetric

Metrics for a sub-page.

public interface
SizeClassesMetric

Expose metrics for an SizeClasses.

public interface
UntetheredMemory

Memory that isn't attached to any particular buffer.

Class Summary

Modifier and TypeClass and Description
pack-priv class
pack-priv class
PoolChunk

Description of algorithm for PageRun/PoolSubpage allocation from PoolChunk Notation: The following terms are important to understand the code > page - a page is the smallest unit of memory chunk that can be allocated > run - a run is a collection of pages > chunk - a chunk is a collection of runs > in this code chunkSize = maxPages * pageSize To begin we allocate a byte array of size = chunkSize Whenever a ByteBuf of given size needs to be created we search for the first position in the byte array that has enough empty space to accommodate the requested size and return a (long) handle that encodes this offset information, (this memory segment is then marked as reserved, so it is always used by exactly one ByteBuf and no more) For simplicity all sizes are normalized according to PoolArena#size2SizeIdx(int) method.

pack-priv class
public class
pack-priv class
pack-priv class
pack-priv class
pack-priv class
PoolThreadCache

Acts a Thread cache for allocations.

pack-priv abstract class
SizeClasses

SizeClasses requires pageShifts to be defined prior to inclusion, and it in turn defines:

LOG2_SIZE_CLASS_GROUP: Log of size class count for each size doubling.

pack-priv class