@Override
    public long usedHeapMemory() {
        return heap.usedMemory();
    }
@Test
    void chunkMustDeallocateOrReuseWthBufferRelease() throws Exception {
        AdaptiveByteBufAllocator allocator = newAllocator(false);
        ByteBuf a = allocator.heapBuffer(8192);
        assertEquals(128 * 1024, allocator.usedHeapMemory());
        ByteBuf b = allocator.heapBuffer(120 * 1024);
        assertEquals(128 * 1024, allocator.usedHeapMemory());
        b.release();
        a.release();
        assertEquals(128 * 1024, allocator.usedHeapMemory());
        a = allocator.heapBuffer(8192);
        assertEquals(128 * 1024, allocator.usedHeapMemory());
        b = allocator.heapBuffer(120 * 1024);
        assertEquals(128 * 1024, allocator.usedHeapMemory());
        a.release();
        ByteBuf c = allocator.heapBuffer(8192);
        assertEquals(2 * 128 * 1024, allocator.usedHeapMemory());
        c.release();
        assertEquals(2 * 128 * 1024, allocator.usedHeapMemory());
        b.release();
        assertEquals(2 * 128 * 1024, allocator.usedHeapMemory());
    }