public class TestingPooledByteBufAllocator extends io.netty.buffer.PooledByteBufAllocator implements Closeable
ByteBufAllocator that tracks outstanding allocations and
throws from the close() method if it detects any leaked buffers.
Never use this class in production, it will cause your server to run out
of memory! This is because it holds strong references to all allocated
buffers and doesn't release them until close() is called at the end of a
unit test.
| Constructor and Description |
|---|
TestingPooledByteBufAllocator() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
io.netty.buffer.CompositeByteBuf |
compositeDirectBuffer(int maxNumComponents) |
io.netty.buffer.CompositeByteBuf |
compositeHeapBuffer(int maxNumComponents) |
protected io.netty.buffer.ByteBuf |
newDirectBuffer(int initialCapacity,
int maxCapacity) |
protected io.netty.buffer.ByteBuf |
newHeapBuffer(int initialCapacity,
int maxCapacity) |
chunkSize, defaultMaxOrder, defaultNormalCacheSize, defaultNumDirectArena, defaultNumHeapArena, defaultPageSize, defaultPreferDirect, defaultSmallCacheSize, defaultTinyCacheSize, defaultUseCacheForAllThreads, directArenas, dumpStats, freeThreadLocalCache, hasThreadLocalCache, heapArenas, isDirectBufferPooled, isDirectMemoryCacheAlignmentSupported, metric, normalCacheSize, numDirectArenas, numHeapArenas, numThreadLocalCaches, smallCacheSize, tinyCacheSizebuffer, buffer, buffer, calculateNewCapacity, compositeBuffer, compositeBuffer, compositeDirectBuffer, compositeHeapBuffer, directBuffer, directBuffer, directBuffer, heapBuffer, heapBuffer, heapBuffer, ioBuffer, ioBuffer, ioBuffer, toLeakAwareBuffer, toLeakAwareBuffer, toStringprotected io.netty.buffer.ByteBuf newHeapBuffer(int initialCapacity,
int maxCapacity)
newHeapBuffer in class io.netty.buffer.PooledByteBufAllocatorprotected io.netty.buffer.ByteBuf newDirectBuffer(int initialCapacity,
int maxCapacity)
newDirectBuffer in class io.netty.buffer.PooledByteBufAllocatorpublic io.netty.buffer.CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
compositeHeapBuffer in interface io.netty.buffer.ByteBufAllocatorcompositeHeapBuffer in class io.netty.buffer.AbstractByteBufAllocatorpublic io.netty.buffer.CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
compositeDirectBuffer in interface io.netty.buffer.ByteBufAllocatorcompositeDirectBuffer in class io.netty.buffer.AbstractByteBufAllocatorpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2012–2020. All rights reserved.