Home / Function/ usedMemory() — netty Function Reference

usedMemory() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  02a85fe5_dcd6_3be9_7157_1b2137312b9e["usedMemory()"]
  f8855572_2abf_1bf6_a32b_5cf6d1cf4947["PooledByteBufAllocatorTest"]
  02a85fe5_dcd6_3be9_7157_1b2137312b9e -->|defined in| f8855572_2abf_1bf6_a32b_5cf6d1cf4947
  08211f11_bee4_3bd9_dbd8_90a0bc23c18e["pinnedMemoryMustReflectBuffersInUse()"]
  08211f11_bee4_3bd9_dbd8_90a0bc23c18e -->|calls| 02a85fe5_dcd6_3be9_7157_1b2137312b9e
  style 02a85fe5_dcd6_3be9_7157_1b2137312b9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java lines 935–947

    private static long usedMemory(List<PoolArenaMetric> arenas) {
        long totalUsed = 0;
        for (PoolArenaMetric arenaMetrics : arenas) {
            for (PoolChunkListMetric arenaMetric : arenaMetrics.chunkLists()) {
                for (PoolChunkMetric chunkMetric : arenaMetric) {
                    // chunkMetric.chunkSize() returns maximum of bytes that can be served out of the chunk
                    // and chunkMetric.freeBytes() returns the bytes that are not yet allocated by in-use buffers
                    totalUsed += chunkMetric.chunkSize() - chunkMetric.freeBytes();
                }
            }
        }
        return totalUsed;
    }

Domain

Subdomains

Frequently Asked Questions

What does usedMemory() do?
usedMemory() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java.
Where is usedMemory() defined?
usedMemory() is defined in buffer/src/test/java/io/netty/buffer/PooledByteBufAllocatorTest.java at line 935.
What calls usedMemory()?
usedMemory() is called by 1 function(s): pinnedMemoryMustReflectBuffersInUse.

Analyze Your Own Codebase

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

Try Supermodel Free