testUsedHeapMemory() — netty Function Reference
Architecture documentation for the testUsedHeapMemory() function in AbstractByteBufAllocatorTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD f2d3fcd9_6f19_eae3_0895_9522237370cb["testUsedHeapMemory()"] 7ff0721a_af2d_e20c_7c69_b0b95f85fcac["AbstractByteBufAllocatorTest"] f2d3fcd9_6f19_eae3_0895_9522237370cb -->|defined in| 7ff0721a_af2d_e20c_7c69_b0b95f85fcac e2d9218f_d9b1_045c_899a_af37dc01f3a2["expectedUsedMemory()"] f2d3fcd9_6f19_eae3_0895_9522237370cb -->|calls| e2d9218f_d9b1_045c_899a_af37dc01f3a2 49f82fa0_2cff_4f13_42f1_efa99057f7ce["expectedUsedMemoryAfterRelease()"] f2d3fcd9_6f19_eae3_0895_9522237370cb -->|calls| 49f82fa0_2cff_4f13_42f1_efa99057f7ce style f2d3fcd9_6f19_eae3_0895_9522237370cb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
buffer/src/test/java/io/netty/buffer/AbstractByteBufAllocatorTest.java lines 160–177
@Test
public void testUsedHeapMemory() {
T allocator = newAllocator(true);
ByteBufAllocatorMetric metric = ((ByteBufAllocatorMetricProvider) allocator).metric();
assertEquals(0, metric.usedHeapMemory());
ByteBuf buffer = allocator.heapBuffer(1024, 4096);
int capacity = buffer.capacity();
assertEquals(expectedUsedMemory(allocator, capacity), metric.usedHeapMemory());
// Double the size of the buffer
buffer.capacity(capacity << 1);
capacity = buffer.capacity();
assertEquals(expectedUsedMemory(allocator, capacity), metric.usedHeapMemory());
buffer.release();
assertEquals(expectedUsedMemoryAfterRelease(allocator, capacity), metric.usedHeapMemory());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testUsedHeapMemory() do?
testUsedHeapMemory() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufAllocatorTest.java.
Where is testUsedHeapMemory() defined?
testUsedHeapMemory() is defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufAllocatorTest.java at line 160.
What does testUsedHeapMemory() call?
testUsedHeapMemory() calls 2 function(s): expectedUsedMemory, expectedUsedMemoryAfterRelease.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free