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;
}
Aggregations