@Test public void testFreePoolChunk() { int chunkSize = 16 * 1024 * 1024; PooledByteBufAllocator allocator = new PooledByteBufAllocator(true, 1, 0, 8192, 11, 0, 0, 0); ByteBuf buffer = allocator.heapBuffer(chunkSize); List<PoolArenaMetric> arenas = allocator.heapArenas(); assertEquals(1, arenas.size()); List<PoolChunkListMetric> lists = arenas.get(0).chunkLists(); assertEquals(6, lists.size()); assertFalse(lists.get(0).iterator().hasNext()); assertFalse(lists.get(1).iterator().hasNext()); assertFalse(lists.get(2).iterator().hasNext()); assertFalse(lists.get(3).iterator().hasNext()); assertFalse(lists.get(4).iterator().hasNext()); assertTrue(lists.get(5).iterator().hasNext()); assertTrue(buffer.release()); assertFalse(lists.get(0).iterator().hasNext()); assertFalse(lists.get(1).iterator().hasNext()); assertFalse(lists.get(2).iterator().hasNext()); assertFalse(lists.get(3).iterator().hasNext()); assertFalse(lists.get(4).iterator().hasNext()); assertFalse(lists.get(5).iterator().hasNext()); }
public List<PoolArenaMetric> heapArenas() { return heapArenaMetrics; }
PooledByteBufAllocator extends AbstractByteBufAllocator { public List<PoolArenaMetric> heapArenas() { return heapArenaMetrics; } }
PooledByteBufAllocator extends AbstractByteBufAllocator { public List<PoolArenaMetric> heapArenas() { return heapArenaMetrics; } PooledByteBufAllocator();  PooledByteBufAllocator(boolean preferDirect);  PooledByteBufAllocator(int nHeapArena, int nDirectArena, int pageSize, int maxOrder);  PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder);  PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder,
                                  int tinyCacheSize, int smallCacheSize, int normalCacheSize); }
PooledByteBufAllocator extends AbstractByteBufAllocator { public List<PoolArenaMetric> heapArenas() { return heapArenaMetrics; } PooledByteBufAllocator();  PooledByteBufAllocator(boolean preferDirect);  PooledByteBufAllocator(int nHeapArena, int nDirectArena, int pageSize, int maxOrder);  PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder);  PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder,
                                  int tinyCacheSize, int smallCacheSize, int normalCacheSize); static int defaultNumHeapArena(); static int defaultNumDirectArena(); static int defaultPageSize(); static int defaultMaxOrder(); static int defaultTinyCacheSize(); static int defaultSmallCacheSize(); static int defaultNormalCacheSize(); @Override boolean isDirectBufferPooled(); @Deprecated boolean hasThreadLocalCache(); @Deprecated void freeThreadLocalCache(); int numHeapArenas(); int numDirectArenas(); List<PoolArenaMetric> heapArenas(); List<PoolArenaMetric> directArenas(); int numThreadLocalCaches(); int tinyCacheSize(); int smallCacheSize(); int normalCacheSize(); String dumpStats(); }
PooledByteBufAllocator extends AbstractByteBufAllocator { public List<PoolArenaMetric> heapArenas() { return heapArenaMetrics; } PooledByteBufAllocator();  PooledByteBufAllocator(boolean preferDirect);  PooledByteBufAllocator(int nHeapArena, int nDirectArena, int pageSize, int maxOrder);  PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder);  PooledByteBufAllocator(boolean preferDirect, int nHeapArena, int nDirectArena, int pageSize, int maxOrder,
                                  int tinyCacheSize, int smallCacheSize, int normalCacheSize); static int defaultNumHeapArena(); static int defaultNumDirectArena(); static int defaultPageSize(); static int defaultMaxOrder(); static int defaultTinyCacheSize(); static int defaultSmallCacheSize(); static int defaultNormalCacheSize(); @Override boolean isDirectBufferPooled(); @Deprecated boolean hasThreadLocalCache(); @Deprecated void freeThreadLocalCache(); int numHeapArenas(); int numDirectArenas(); List<PoolArenaMetric> heapArenas(); List<PoolArenaMetric> directArenas(); int numThreadLocalCaches(); int tinyCacheSize(); int smallCacheSize(); int normalCacheSize(); String dumpStats(); static final PooledByteBufAllocator DEFAULT; }