| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private abstract static class | |
| private static class | |
| private static class | PoolThreadCache.SubPageMemoryRegionCache<T>
Cache used for buffers which are backed by TINY or SMALL size. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| pack-priv final PoolArena | |
| private final AtomicBoolean | |
| private final PoolThreadCache. | |
| private final int | |
| pack-priv final PoolArena | |
| private static final int | |
| private static final InternalLogger | |
| private final PoolThreadCache. | |
| private final PoolThreadCache. | |
| private final PoolThreadCache. | |
| private final PoolThreadCache. |
| Access | Constructor and Description |
|---|---|
| pack-priv | PoolThreadCache(PoolArena<byte[]> heapArena, PoolArena<ByteBuffer> directArena, int smallCacheSize, int normalCacheSize, int maxCachedBufferCapacity, int freeSweepAllocationThreshold, boolean useFinalizer)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| private boolean | |
| pack-priv boolean | allocateNormal(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int sizeIdx)
Try to allocate a normal buffer out of the cache. |
| pack-priv boolean | allocateSmall(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int sizeIdx)
Try to allocate a small buffer out of the cache. |
| private PoolThreadCache. | |
| private static <T> PoolThreadCache. | |
| private PoolThreadCache. | |
| private PoolThreadCache. | |
| private static void | |
| private static <T> PoolThreadCache. | |
| private static <T> PoolThreadCache. | |
| pack-priv void | free(boolean finalizer)
Should be called if the Thread that uses this cache is about to exist to release resources out of the cache |
| private static int | |
| private static int | |
| pack-priv static int | |
| pack-priv void | |
| private static void | |
| private static void |
| allocations | back to summary |
|---|---|
| private int allocations | |
| directArena | back to summary |
|---|---|
| pack-priv final PoolArena<ByteBuffer> directArena | |
| freed | back to summary |
|---|---|
| private final AtomicBoolean freed | |
| freeOnFinalize | back to summary |
|---|---|
private final PoolThreadCache.
| |
| freeSweepAllocationThreshold | back to summary |
|---|---|
| private final int freeSweepAllocationThreshold | |
| heapArena | back to summary |
|---|---|
| pack-priv final PoolArena<byte[]> heapArena | |
| INTEGER_SIZE_MINUS_ONE | back to summary |
|---|---|
| private static final int INTEGER_SIZE_MINUS_ONE | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| normalDirectCaches | back to summary |
|---|---|
| private final PoolThreadCache. | |
| normalHeapCaches | back to summary |
|---|---|
| private final PoolThreadCache. | |
| smallSubPageDirectCaches | back to summary |
|---|---|
| private final PoolThreadCache. | |
| smallSubPageHeapCaches | back to summary |
|---|---|
| private final PoolThreadCache. | |
| PoolThreadCache | back to summary |
|---|---|
| pack-priv PoolThreadCache(PoolArena<byte[]> heapArena, PoolArena<ByteBuffer> directArena, int smallCacheSize, int normalCacheSize, int maxCachedBufferCapacity, int freeSweepAllocationThreshold, boolean useFinalizer) | |
| add | back to summary |
|---|---|
| pack-priv boolean add(PoolArena<?> area, PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, int normCapacity, PoolArena. Add
| |
| allocate | back to summary |
|---|---|
private boolean allocate(PoolThreadCache.
| |
| allocateNormal | back to summary |
|---|---|
| pack-priv boolean allocateNormal(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int sizeIdx) Try to allocate a normal buffer out of the cache. Returns | |
| allocateSmall | back to summary |
|---|---|
| pack-priv boolean allocateSmall(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int sizeIdx) Try to allocate a small buffer out of the cache. Returns | |
| cache | back to summary |
|---|---|
| private PoolThreadCache. | |
| cache | back to summary |
|---|---|
| private static <T> PoolThreadCache. | |
| cacheForNormal | back to summary |
|---|---|
| private PoolThreadCache. | |
| cacheForSmall | back to summary |
|---|---|
| private PoolThreadCache. | |
| checkCacheMayLeak | back to summary |
|---|---|
| private static void checkCacheMayLeak(PoolThreadCache. | |
| createNormalCaches | back to summary |
|---|---|
private static <T> PoolThreadCache.
| |
| createSubPageCaches | back to summary |
|---|---|
| private static <T> PoolThreadCache. | |
| free | back to summary |
|---|---|
| pack-priv void free(boolean finalizer) Should be called if the Thread that uses this cache is about to exist to release resources out of the cache | |
| free | back to summary |
|---|---|
| private static int free(PoolThreadCache. | |
| free | back to summary |
|---|---|
| private static int free(PoolThreadCache. | |
| log2 | back to summary |
|---|---|
| pack-priv static int log2(int val) | |
| trim | back to summary |
|---|---|
| pack-priv void trim() | |
| trim | back to summary |
|---|---|
| private static void trim(PoolThreadCache. | |
| trim | back to summary |
|---|---|
| private static void trim(PoolThreadCache. | |
| Modifier and Type | Field and Description |
|---|---|
| private final PoolThreadCache |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void | finalize()
Overrides java. |
| cache | back to summary |
|---|---|
| private final PoolThreadCache cache | |
| FreeOnFinalize | back to summary |
|---|---|
| private FreeOnFinalize(PoolThreadCache cache) | |
| finalize | back to summary |
|---|---|
| protected void finalize() throws Throwable Overrides java. Doc from java. Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the
When running in a Java virtual machine in which finalization has been
disabled or removed, the garbage collector will never call
The general contract of
The
The Java programming language does not guarantee which thread will
invoke the
After the
The
Any exception thrown by the
| |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final Queue | |
| private static final ObjectPool | |
| private final int | |
| private final PoolArena. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | add(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, int normCapacity)
Add to cache if not already full. |
| public final boolean | allocate(PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache)
Allocate something out of the cache if possible and remove the entry from the cache. |
| public final int | |
| private int | |
| private void | |
| protected abstract void | initBuf(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache)
Init the |
| private static PoolThreadCache. | |
| public final void |
| allocations | back to summary |
|---|---|
| private int allocations | |
| queue | back to summary |
|---|---|
| private final Queue<PoolThreadCache. | |
| RECYCLER | back to summary |
|---|---|
private static final ObjectPool<PoolThreadCache.
| |
| size | back to summary |
|---|---|
| private final int size | |
| sizeClass | back to summary |
|---|---|
| private final PoolArena. | |
| MemoryRegionCache | back to summary |
|---|---|
| pack-priv MemoryRegionCache(int size, PoolArena. | |
| add | back to summary |
|---|---|
| public final boolean add(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, int normCapacity) Add to cache if not already full.
| |
| allocate | back to summary |
|---|---|
| public final boolean allocate(PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache) Allocate something out of the cache if possible and remove the entry from the cache. | |
| free | back to summary |
|---|---|
| public final int free(boolean finalizer) Clear out this cache and free up all previous cached | |
| free | back to summary |
|---|---|
| private int free(int max, boolean finalizer) | |
| freeEntry | back to summary |
|---|---|
private void freeEntry(PoolThreadCache.
| |
| initBuf | back to summary |
|---|---|
| protected abstract void initBuf(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache) Init the | |
| newEntry | back to summary |
|---|---|
private static PoolThreadCache.
| |
| trim | back to summary |
|---|---|
| public final void trim() Free up cached | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv PoolChunk | |
| pack-priv long | |
| pack-priv ByteBuffer | |
| pack-priv int | |
| pack-priv final Recycler. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void |
| chunk | back to summary |
|---|---|
| pack-priv PoolChunk<T> chunk | |
| handle | back to summary |
|---|---|
| pack-priv long handle | |
| nioBuffer | back to summary |
|---|---|
| pack-priv ByteBuffer nioBuffer | |
| normCapacity | back to summary |
|---|---|
| pack-priv int normCapacity | |
| recyclerHandle | back to summary |
|---|---|
| pack-priv final Recycler. | |
| Entry | back to summary |
|---|---|
| pack-priv Entry(ObjectPool. | |
| recycle | back to summary |
|---|---|
| pack-priv void recycle() | |
| unguardedRecycle | back to summary |
|---|---|
| pack-priv void unguardedRecycle() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | initBuf(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache)
Implements abstract io. PooledByteBuf using the provided chunk and handle with the capacity restrictions.
|
| NormalMemoryRegionCache | back to summary |
|---|---|
| pack-priv NormalMemoryRegionCache(int size) | |
| initBuf | back to summary |
|---|---|
| protected void initBuf(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache) Implements abstract io. Doc from io. Init the
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | initBuf(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache)
Implements abstract io. PooledByteBuf using the provided chunk and handle with the capacity restrictions.
|
| SubPageMemoryRegionCache | back to summary |
|---|---|
| pack-priv SubPageMemoryRegionCache(int size) | |
| initBuf | back to summary |
|---|---|
| protected void initBuf(PoolChunk<T> chunk, ByteBuffer nioBuffer, long handle, PooledByteBuf<T> buf, int reqCapacity, PoolThreadCache threadCache) Implements abstract io. Doc from io. Init the
| |