Search in sources :

Example 6 with PoolSubpageMetric

use of io.netty.buffer.PoolSubpageMetric in project jocean-http by isdom.

the class PooledAllocatorStats method activeAllocationsInBytes.

private static long activeAllocationsInBytes(final List<PoolSubpageMetric> subpages) {
    long totalBytes = 0;
    for (PoolSubpageMetric subpage : subpages) {
        // 页面是从 PoolChunkList 中分配的,所以先去掉该页面在前述计算进去的 bytes
        totalBytes -= subpage.pageSize();
        // 将该 Subpage 实际分配出去的 bytes 算入 totalBytes
        totalBytes += activeAllocationsInBytes(subpage);
    }
    return totalBytes;
}
Also used : PoolSubpageMetric(io.netty.buffer.PoolSubpageMetric)

Aggregations

PoolSubpageMetric (io.netty.buffer.PoolSubpageMetric)6 PoolArenaMetric (io.netty.buffer.PoolArenaMetric)3 PoolChunkListMetric (io.netty.buffer.PoolChunkListMetric)3 NettyBufferPool (io.mycat.buffer.NettyBufferPool)2 EOFPacket (io.mycat.net.mysql.EOFPacket)2 FieldPacket (io.mycat.net.mysql.FieldPacket)2 RowDataPacket (io.mycat.net.mysql.RowDataPacket)2 PoolChunkMetric (io.netty.buffer.PoolChunkMetric)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 ByteBuffer (java.nio.ByteBuffer)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 HashMap (java.util.HashMap)1