Home / Function/ adaptiveChunkMustDeallocateOrReuseWthBufferRelease() — netty Function Reference

adaptiveChunkMustDeallocateOrReuseWthBufferRelease() — netty Function Reference

Architecture documentation for the adaptiveChunkMustDeallocateOrReuseWthBufferRelease() function in AdaptiveByteBufAllocatorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6b6bca45_42b2_d4bd_281f_847fcd857657["adaptiveChunkMustDeallocateOrReuseWthBufferRelease()"]
  b5780ec9_74a4_594b_4225_0099765d71e7["AdaptiveByteBufAllocatorTest"]
  6b6bca45_42b2_d4bd_281f_847fcd857657 -->|defined in| b5780ec9_74a4_594b_4225_0099765d71e7
  style 6b6bca45_42b2_d4bd_281f_847fcd857657 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AdaptiveByteBufAllocatorTest.java lines 130–156

    @Test
    void adaptiveChunkMustDeallocateOrReuseWthBufferRelease() throws Exception {
        AdaptiveByteBufAllocator allocator = newAllocator(false);
        Deque<ByteBuf> bufs = new ArrayDeque<>();
        assertEquals(0, allocator.usedHeapMemory());
        assertEquals(0, allocator.usedHeapMemory());
        bufs.add(allocator.heapBuffer(256));
        long usedHeapMemory = allocator.usedHeapMemory();
        int buffersPerChunk = Math.toIntExact(usedHeapMemory / 256);
        for (int i = 0; i < buffersPerChunk; i++) {
            bufs.add(allocator.heapBuffer(256));
        }
        assertEquals(2 * usedHeapMemory, allocator.usedHeapMemory());
        bufs.pop().release();
        assertEquals(2 * usedHeapMemory, allocator.usedHeapMemory());
        while (!bufs.isEmpty()) {
            bufs.pop().release();
        }
        assertEquals(2 * usedHeapMemory, allocator.usedHeapMemory());
        for (int i = 0; i < 2 * buffersPerChunk; i++) {
            bufs.add(allocator.heapBuffer(256));
        }
        assertEquals(2 * usedHeapMemory, allocator.usedHeapMemory());
        while (!bufs.isEmpty()) {
            bufs.pop().release();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does adaptiveChunkMustDeallocateOrReuseWthBufferRelease() do?
adaptiveChunkMustDeallocateOrReuseWthBufferRelease() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AdaptiveByteBufAllocatorTest.java.
Where is adaptiveChunkMustDeallocateOrReuseWthBufferRelease() defined?
adaptiveChunkMustDeallocateOrReuseWthBufferRelease() is defined in buffer/src/test/java/io/netty/buffer/AdaptiveByteBufAllocatorTest.java at line 130.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free