Top Inners Fields Constructors Methods
io.netty.buffer

pack-priv abstract Class PoolArena<T>

extends Object
implements PoolArenaMetric
Class Inheritance
All Implemented Interfaces
io.netty.buffer.PoolArenaMetric, io.netty.buffer.SizeClassesMetric
Known Direct Subclasses
io.netty.buffer.PoolArena.HeapArena, io.netty.buffer.PoolArena.DirectArena
Imports
io.netty.util.internal.LongCounter, .PlatformDependent, .StringUtil, java.nio.ByteBuffer, java.util.ArrayList, .Collections, .List, java.util.concurrent.atomic.AtomicInteger, java.util.concurrent.locks.ReentrantLock

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final LongCounter
private final LongCounter
private long
private final LongCounter
private final List<PoolChunkListMetric>
private final LongCounter
private long
private long
private static final boolean
private final ReentrantLock
pack-priv final AtomicInteger
pack-priv final PooledByteBufAllocator
private final PoolChunkList<T>
private final PoolChunkList<T>
private final PoolChunkList<T>
private final PoolChunkList<T>
private final PoolChunkList<T>
private final PoolChunkList<T>
pack-priv final SizeClasses
pack-priv final PoolSubpage<T>[]

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
pack-priv PooledByteBuf<T>
allocate(PoolThreadCache cache, int reqCapacity, int maxCapacity)

private void
allocate(PoolThreadCache cache, PooledByteBuf<T> buf, final int reqCapacity)

private void
allocateHuge(PooledByteBuf<T> buf, int reqCapacity)

private void
allocateNormal(PooledByteBuf<T> buf, int reqCapacity, int sizeIdx, PoolThreadCache threadCache)

private static void
public List<PoolChunkListMetric>
chunkLists()

Implements io.netty.buffer.PoolArenaMetric.chunkLists.

Returns an unmodifiable List which holds PoolChunkListMetrics.
protected abstract void
private void
private static void
protected final void
finalize()

Overrides java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
pack-priv void
free(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, int normCapacity, PoolThreadCache cache)

pack-priv void
freeChunk(PoolChunk<T> chunk, long handle, int normCapacity, PoolArena.SizeClass sizeClass, ByteBuffer nioBuffer, boolean finalizer)

private void
pack-priv abstract boolean
pack-priv void
lock()

protected abstract void
memoryCopy(T src, int srcOffset, PooledByteBuf<T> dst, int length)

protected abstract PooledByteBuf<T>
newByteBuf(int maxCapacity)

protected abstract PoolChunk<T>
newChunk(int pageSize, int maxPageIdx, int pageShifts, int chunkSize)

private PoolSubpage<T>[]
private PoolSubpage<T>
newSubpagePoolHead(int index)

protected abstract PoolChunk<T>
newUnpooledChunk(int capacity)

public int
normalizeSize(int
request size
size
)

Implements io.netty.buffer.SizeClassesMetric.normalizeSize.

Normalizes usable size that would result from allocating an object with the specified size and alignment.
public long
numActiveAllocations()

Implements io.netty.buffer.PoolArenaMetric.numActiveAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numActiveBytes.

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

Implements io.netty.buffer.PoolArenaMetric.numActiveHugeAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numActiveNormalAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numActiveSmallAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numActiveTinyAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numChunkLists.

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

Implements io.netty.buffer.PoolArenaMetric.numDeallocations.

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

Implements io.netty.buffer.PoolArenaMetric.numHugeAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numHugeDeallocations.

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

Implements io.netty.buffer.PoolArenaMetric.numNormalAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numNormalDeallocations.

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

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

public long
numSmallAllocations()

Implements io.netty.buffer.PoolArenaMetric.numSmallAllocations.

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

Implements io.netty.buffer.PoolArenaMetric.numSmallDeallocations.

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

Implements io.netty.buffer.PoolArenaMetric.numSmallSubpages.

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

Implements io.netty.buffer.PoolArenaMetric.numThreadCaches.

Returns the number of thread caches backed by this arena.
public long
numTinyAllocations()

Implements io.netty.buffer.PoolArenaMetric.numTinyAllocations.

Return the number of tiny allocations done via the arena.
public long
numTinyDeallocations()

Implements io.netty.buffer.PoolArenaMetric.numTinyDeallocations.

Return the number of tiny deallocations done via the arena.
public int
numTinySubpages()

Implements io.netty.buffer.PoolArenaMetric.numTinySubpages.

Returns the number of tiny sub-pages for the arena.
public long
pageIdx2size(int pageIdx)

Implements io.netty.buffer.SizeClassesMetric.pageIdx2size.

Computes size from lookup table according to pageIdx.
public long
pageIdx2sizeCompute(int pageIdx)

Implements io.netty.buffer.SizeClassesMetric.pageIdx2sizeCompute.

Computes size according to pageIdx.
public int
pages2pageIdx(int
multiples of pageSizes
pages
)

Implements io.netty.buffer.SizeClassesMetric.pages2pageIdx.

Normalizes request size up to the nearest pageSize class.
public int
pages2pageIdxFloor(int
multiples of pageSizes
pages
)

Implements io.netty.buffer.SizeClassesMetric.pages2pageIdxFloor.

Normalizes request size down to the nearest pageSize class.
pack-priv void
reallocate(PooledByteBuf<T> buf, int newCapacity)

public int
size2SizeIdx(int
request size
size
)

Implements io.netty.buffer.SizeClassesMetric.size2SizeIdx.

Normalizes request size up to the nearest size class.
private static PoolArena.SizeClass
sizeClass(long handle)

public int
sizeIdx2size(int sizeIdx)

Implements io.netty.buffer.SizeClassesMetric.sizeIdx2size.

Computes size from lookup table according to sizeIdx.
public int
sizeIdx2sizeCompute(int sizeIdx)

Implements io.netty.buffer.SizeClassesMetric.sizeIdx2sizeCompute.

Computes size according to sizeIdx.
public List<PoolSubpageMetric>
smallSubpages()

Implements io.netty.buffer.PoolArenaMetric.smallSubpages.

Returns an unmodifiable List which holds PoolSubpageMetrics for small sub-pages.
private static List<PoolSubpageMetric>
private void
tcacheAllocateNormal(PoolThreadCache cache, PooledByteBuf<T> buf, final int reqCapacity, final int sizeIdx)

private void
tcacheAllocateSmall(PoolThreadCache cache, PooledByteBuf<T> buf, final int reqCapacity, final int sizeIdx)

public List<PoolSubpageMetric>
tinySubpages()

Implements io.netty.buffer.PoolArenaMetric.tinySubpages.

Returns an unmodifiable List which holds PoolSubpageMetrics for tiny sub-pages.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv void
Inherited from java.lang.Object:
cloneequalsgetClasshashCodenotifynotifyAllwaitwaitwait