Home / Function/ testNormalPoolSubpageRelease() — netty Function Reference

testNormalPoolSubpageRelease() — netty Function Reference

Architecture documentation for the testNormalPoolSubpageRelease() function in PooledByteBufAllocatorTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f189ad4b_3a43_9310_d7c0_2b4b47c7a711["testNormalPoolSubpageRelease()"]
  f8855572_2abf_1bf6_a32b_5cf6d1cf4947["PooledByteBufAllocatorTest"]
  f189ad4b_3a43_9310_d7c0_2b4b47c7a711 -->|defined in| f8855572_2abf_1bf6_a32b_5cf6d1cf4947
  4e681469_9c14_67cb_5890_46b5d4b12dd2["PooledByteBufAllocator()"]
  f189ad4b_3a43_9310_d7c0_2b4b47c7a711 -->|calls| 4e681469_9c14_67cb_5890_46b5d4b12dd2
  7eb106b2_cdf3_2750_a655_d411ed211f7c["unwrapIfNeeded()"]
  f189ad4b_3a43_9310_d7c0_2b4b47c7a711 -->|calls| 7eb106b2_cdf3_2750_a655_d411ed211f7c
  style f189ad4b_3a43_9310_d7c0_2b4b47c7a711 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java lines 713–734

    @Test
    public void testNormalPoolSubpageRelease() {
        // 16 < elemSize <= 7168 or 8192 < elemSize <= 28672, 1 < subpage.maxNumElems <= 256
        // 7168 <= elemSize <= 8192, subpage.maxNumElems == 1
        int elemSize = 8192;
        int length = 1024;
        ByteBuf[] byteBufs = new ByteBuf[length];
        final PooledByteBufAllocator allocator = new PooledByteBufAllocator(false, 32, 32, 8192, 11, 256, 64, false, 0);

        for (int i = 0; i < length; i++) {
            byteBufs[i] = allocator.heapBuffer(elemSize, elemSize);
        }
        PoolChunk<Object> chunk = unwrapIfNeeded(byteBufs[0]).chunk;

        int beforeFreeBytes = chunk.freeBytes();
        for (int i = 0; i < length; i++) {
            byteBufs[i].release();
        }
        int afterFreeBytes = chunk.freeBytes();

        assertTrue(beforeFreeBytes < afterFreeBytes);
    }

Domain

Subdomains

Frequently Asked Questions

What does testNormalPoolSubpageRelease() do?
testNormalPoolSubpageRelease() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java.
Where is testNormalPoolSubpageRelease() defined?
testNormalPoolSubpageRelease() is defined in buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java at line 713.
What does testNormalPoolSubpageRelease() call?
testNormalPoolSubpageRelease() calls 2 function(s): PooledByteBufAllocator, unwrapIfNeeded.

Analyze Your Own Codebase

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

Try Supermodel Free