Top Inners Fields Constructors Methods
io.netty5.buffer.pool

pack-priv Class PoolArena

extends SizeClasses
implements PoolArenaMetric
Class Inheritance
All Implemented Interfaces
io.netty5.buffer.pool.PoolArenaMetric, io.netty5.buffer.pool.SizeClassesMetric
Imports
io.netty5.buffer.AllocationType, .MemoryManager, io.netty5.util.internal.StringUtil, java.lang.invoke.MethodHandles, .VarHandle, java.util.ArrayList, .List, java.util.concurrent.atomic.AtomicInteger, .LongAdder, java.util.concurrent.locks.ReentrantLock

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final LongAdder
private final LongAdder
private long
private final LongAdder
pack-priv final AllocationType
private final List<PoolChunkListMetric>
private final LongAdder
private long
private long
pack-priv final int
private final ReentrantLock
pack-priv final MemoryManager
pack-priv final int
pack-priv final AtomicInteger
pack-priv final PooledBufferAllocator
private final PoolChunkList
private final PoolChunkList
private final PoolChunkList
private final PoolChunkList
private final PoolChunkList
private final PoolChunkList
private final PoolSubpage[]
private static final VarHandle
Inherited from io.netty5.buffer.pool.SizeClasses:
chunkSizeLOG2_QUANTUMnPSizesnSizesnSubpagespageShiftspageSizesmallMaxSizeIdx

Constructor Summary

AccessConstructor and Description
protected
PoolArena(PooledBufferAllocator parent, MemoryManager manager, AllocationType allocationType, int pageSize, int pageShifts, int chunkSize, int cacheAlignment)

Method Summary

Modifier and TypeMethod and Description
pack-priv UntetheredMemory
allocate(PoolThreadCache cache, int size)

private UntetheredMemory
allocateHuge(int size)

private UntetheredMemory
allocateNormal(int size, int sizeIdx, PoolThreadCache threadCache)

private static void
public List<PoolChunkListMetric>
chunkLists()

Implements io.netty5.buffer.pool.PoolArenaMetric.chunkLists.

Returns an unmodifiable List which holds PoolChunkListMetrics.
public void
pack-priv PoolSubpage
findSubpagePoolHead(int sizeIdx)

pack-priv void
free(PoolChunk chunk, long handle, int normCapacity, PoolThreadCache cache)

pack-priv void
freeChunk(PoolChunk chunk, long handle, int normCapacity, PoolArena.SizeClass sizeClass)

private void
pack-priv void
lock()

protected final PoolChunk
newChunk(int pageSize, int maxPageIdx, int pageShifts, int chunkSize)

private static PoolSubpage[]
private static PoolSubpage
public long
numActiveAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveAllocations.

Return the number of currently active allocations.
public long
numActiveBytes()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveBytes.

Return the number of active bytes that are currently allocated by the arena.
public long
numActiveHugeAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveHugeAllocations.

Return the number of currently active huge allocations.
public long
numActiveNormalAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveNormalAllocations.

Return the number of currently active normal allocations.
public long
numActiveSmallAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveSmallAllocations.

Return the number of currently active small allocations.
public long
numAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numAllocations.

Return the number of allocations done via the arena.
public int
numChunkLists()

Implements io.netty5.buffer.pool.PoolArenaMetric.numChunkLists.

Returns the number of chunk lists for the arena.
public long
numDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numDeallocations.

Return the number of deallocations done via the arena.
public long
numHugeAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numHugeAllocations.

Return the number of huge allocations done via the arena.
public long
numHugeDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numHugeDeallocations.

Return the number of huge deallocations done via the arena.
public long
numNormalAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numNormalAllocations.

Return the number of normal allocations done via the arena.
public long
numNormalDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numNormalDeallocations.

Return the number of normal deallocations done via the arena.
public long
numPinnedBytes()

Implements io.netty5.buffer.pool.PoolArenaMetric.numPinnedBytes.

Return the number of bytes that are currently pinned to buffer instances, by the arena.
public long
numSmallAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numSmallAllocations.

Return the number of small allocations done via the arena.
public long
numSmallDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numSmallDeallocations.

Return the number of small deallocations done via the arena.
public int
numSmallSubpages()

Implements io.netty5.buffer.pool.PoolArenaMetric.numSmallSubpages.

Returns the number of small sub-pages for the arena.
public int
numThreadCaches()

Implements io.netty5.buffer.pool.PoolArenaMetric.numThreadCaches.

Returns the number of thread caches backed by this arena.
private static PoolArena.SizeClass
sizeClass(long handle)

public List<PoolSubpageMetric>
smallSubpages()

Implements io.netty5.buffer.pool.PoolArenaMetric.smallSubpages.

Returns an unmodifiable List which holds PoolSubpageMetrics for small sub-pages.
private static List<PoolSubpageMetric>
private UntetheredMemory
tcacheAllocateNormal(PoolThreadCache cache, int size, int sizeIdx)

private UntetheredMemory
tcacheAllocateSmall(PoolThreadCache cache, final int size, final int sizeIdx)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv void
Inherited from io.netty5.buffer.pool.SizeClasses:
normalizeSizepageIdx2sizepageIdx2sizeComputepages2pageIdxpages2pageIdxFloorsize2SizeIdxsizeIdx2sizesizeIdx2sizeCompute

Field Detail

activeBytesHugeback to summary
private final LongAdder activeBytesHuge
allocationsHugeback to summary
private final LongAdder allocationsHuge
allocationsNormalback to summary
private long allocationsNormal
allocationsSmallback to summary
private final LongAdder allocationsSmall
allocationTypeback to summary
pack-priv final AllocationType allocationType
chunkListMetricsback to summary
private final List<PoolChunkListMetric> chunkListMetrics
deallocationsHugeback to summary
private final LongAdder deallocationsHuge
deallocationsNormalback to summary
private long deallocationsNormal
deallocationsSmallback to summary
private long deallocationsSmall
directMemoryCacheAlignmentback to summary
pack-priv final int directMemoryCacheAlignment

Hides io.netty5.buffer.pool.SizeClasses.directMemoryCacheAlignment.

lockback to summary
private final ReentrantLock lock
managerback to summary
pack-priv final MemoryManager manager
numSmallSubpagePoolsback to summary
pack-priv final int numSmallSubpagePools
numThreadCachesback to summary
pack-priv final AtomicInteger numThreadCaches
parentback to summary
pack-priv final PooledBufferAllocator parent
q000back to summary
private final PoolChunkList q000
q025back to summary
private final PoolChunkList q025
q050back to summary
private final PoolChunkList q050
q075back to summary
private final PoolChunkList q075
q100back to summary
private final PoolChunkList q100
qInitback to summary
private final PoolChunkList qInit
smallSubpagePoolsback to summary
private final PoolSubpage[] smallSubpagePools
SUBPAGE_ARRAYback to summary
private static final VarHandle SUBPAGE_ARRAY

Constructor Detail

PoolArenaback to summary
protected PoolArena(PooledBufferAllocator parent, MemoryManager manager, AllocationType allocationType, int pageSize, int pageShifts, int chunkSize, int cacheAlignment)

Method Detail

allocateback to summary
pack-priv UntetheredMemory allocate(PoolThreadCache cache, int size)
allocateHugeback to summary
private UntetheredMemory allocateHuge(int size)
allocateNormalback to summary
private UntetheredMemory allocateNormal(int size, int sizeIdx, PoolThreadCache threadCache)
appendPoolSubPagesback to summary
private static void appendPoolSubPages(StringBuilder buf, PoolSubpage[] subpages)
chunkListsback to summary
public List<PoolChunkListMetric> chunkLists()

Implements io.netty5.buffer.pool.PoolArenaMetric.chunkLists.

Doc from io.netty5.buffer.pool.PoolArenaMetric.chunkLists.

Returns an unmodifiable List which holds PoolChunkListMetrics.

Annotations
@Override
closeback to summary
public void close()
findSubpagePoolHeadback to summary
pack-priv PoolSubpage findSubpagePoolHead(int sizeIdx)
freeback to summary
pack-priv void free(PoolChunk chunk, long handle, int normCapacity, PoolThreadCache cache)
freeChunkback to summary
pack-priv void freeChunk(PoolChunk chunk, long handle, int normCapacity, PoolArena.SizeClass sizeClass)
incSmallAllocationback to summary
private void incSmallAllocation()
lockback to summary
pack-priv void lock()
newChunkback to summary
protected final PoolChunk newChunk(int pageSize, int maxPageIdx, int pageShifts, int chunkSize)
newSubpagePoolArrayback to summary
private static PoolSubpage[] newSubpagePoolArray(int size)
newSubpagePoolHeadback to summary
private static PoolSubpage newSubpagePoolHead()
numActiveAllocationsback to summary
public long numActiveAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numActiveAllocations.

Return the number of currently active allocations.

Annotations
@Override
numActiveBytesback to summary
public long numActiveBytes()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveBytes.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numActiveBytes.

Return the number of active bytes that are currently allocated by the arena.

Annotations
@Override
numActiveHugeAllocationsback to summary
public long numActiveHugeAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveHugeAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numActiveHugeAllocations.

Return the number of currently active huge allocations.

Annotations
@Override
numActiveNormalAllocationsback to summary
public long numActiveNormalAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveNormalAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numActiveNormalAllocations.

Return the number of currently active normal allocations.

Annotations
@Override
numActiveSmallAllocationsback to summary
public long numActiveSmallAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numActiveSmallAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numActiveSmallAllocations.

Return the number of currently active small allocations.

Annotations
@Override
numAllocationsback to summary
public long numAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numAllocations.

Return the number of allocations done via the arena. This includes all sizes.

Annotations
@Override
numChunkListsback to summary
public int numChunkLists()

Implements io.netty5.buffer.pool.PoolArenaMetric.numChunkLists.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numChunkLists.

Returns the number of chunk lists for the arena.

Annotations
@Override
numDeallocationsback to summary
public long numDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numDeallocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numDeallocations.

Return the number of deallocations done via the arena. This includes all sizes.

Annotations
@Override
numHugeAllocationsback to summary
public long numHugeAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numHugeAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numHugeAllocations.

Return the number of huge allocations done via the arena.

Annotations
@Override
numHugeDeallocationsback to summary
public long numHugeDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numHugeDeallocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numHugeDeallocations.

Return the number of huge deallocations done via the arena.

Annotations
@Override
numNormalAllocationsback to summary
public long numNormalAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numNormalAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numNormalAllocations.

Return the number of normal allocations done via the arena.

Annotations
@Override
numNormalDeallocationsback to summary
public long numNormalDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numNormalDeallocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numNormalDeallocations.

Return the number of normal deallocations done via the arena.

Annotations
@Override
numPinnedBytesback to summary
public long numPinnedBytes()

Implements io.netty5.buffer.pool.PoolArenaMetric.numPinnedBytes.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numPinnedBytes.

Return the number of bytes that are currently pinned to buffer instances, by the arena.

Annotations
@Override
numSmallAllocationsback to summary
public long numSmallAllocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numSmallAllocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numSmallAllocations.

Return the number of small allocations done via the arena.

Annotations
@Override
numSmallDeallocationsback to summary
public long numSmallDeallocations()

Implements io.netty5.buffer.pool.PoolArenaMetric.numSmallDeallocations.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numSmallDeallocations.

Return the number of small deallocations done via the arena.

Annotations
@Override
numSmallSubpagesback to summary
public int numSmallSubpages()

Implements io.netty5.buffer.pool.PoolArenaMetric.numSmallSubpages.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numSmallSubpages.

Returns the number of small sub-pages for the arena.

Annotations
@Override
numThreadCachesback to summary
public int numThreadCaches()

Implements io.netty5.buffer.pool.PoolArenaMetric.numThreadCaches.

Doc from io.netty5.buffer.pool.PoolArenaMetric.numThreadCaches.

Returns the number of thread caches backed by this arena.

Annotations
@Override
sizeClassback to summary
private static PoolArena.SizeClass sizeClass(long handle)
smallSubpagesback to summary
public List<PoolSubpageMetric> smallSubpages()

Implements io.netty5.buffer.pool.PoolArenaMetric.smallSubpages.

Doc from io.netty5.buffer.pool.PoolArenaMetric.smallSubpages.

Returns an unmodifiable List which holds PoolSubpageMetrics for small sub-pages.

Annotations
@Override
subPageMetricListback to summary
private static List<PoolSubpageMetric> subPageMetricList(PoolSubpage[] pages)
tcacheAllocateNormalback to summary
private UntetheredMemory tcacheAllocateNormal(PoolThreadCache cache, int size, int sizeIdx)
tcacheAllocateSmallback to summary
private UntetheredMemory tcacheAllocateSmall(PoolThreadCache cache, final int size, final int sizeIdx)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
unlockback to summary
pack-priv void unlock()
io.netty5.buffer.pool back to summary

pack-priv final Enum PoolArena.SizeClass

extends Enum<PoolArena.SizeClass>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final PoolArena.SizeClass
public static final PoolArena.SizeClass

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static PoolArena.SizeClass
public static PoolArena.SizeClass[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

Normalback to summary
public static final PoolArena.SizeClass Normal
Smallback to summary
public static final PoolArena.SizeClass Small

Constructor Detail

SizeClassback to summary
private SizeClass()

Method Detail

valueOfback to summary
public static PoolArena.SizeClass valueOf(String name)
valuesback to summary
public static PoolArena.SizeClass[] values()