io.netty5.buffer.BufferAllocator implementation based on jemalloc.
| Modifier and Type | Interface 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. |
| Modifier and Type | Class 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 |
| pack-priv class | |
| public class | |
| pack-priv class | PooledBufferAllocatorMetric
Exposed metric for |
| pack-priv class | |
| pack-priv class | |
| pack-priv class | PoolThreadCache
Acts a Thread cache for allocations. |
| pack-priv abstract class | SizeClasses
SizeClasses requires LOG2_SIZE_CLASS_GROUP: Log of size class count for each size doubling. |
| pack-priv class |