Zheng Hu created HBASE-22663: -------------------------------- Summary: The HeapAllocationRatio in WebUI is not accurate because all of the heap allocation will happen in another separated allocator named HEAP Key: HBASE-22663 URL: https://issues.apache.org/jira/browse/HBASE-22663 Project: HBase Issue Type: Sub-task Reporter: Zheng Hu Assignee: Zheng Hu
We use the following method to calculate the heap allocation ratio: {code} public double getHeapAllocationRatio() { long heapAllocBytes = heapAllocationBytes.sum(), poolAllocBytes = poolAllocationBytes.sum(); double heapDelta = heapAllocBytes - lastHeapAllocationBytes; double poolDelta = poolAllocBytes - lastPoolAllocationBytes; lastHeapAllocationBytes = heapAllocBytes; lastPoolAllocationBytes = poolAllocBytes; if (Math.abs(heapDelta + poolDelta) < 1e-3) { return 0.0; } return heapDelta / (heapDelta + poolDelta); } {code} While we also defined a static allocator instance, named HEAP: {code} // The on-heap allocator is mostly used for testing, but also some non-test usage, such as // scanning snapshot, we won't have an RpcServer to initialize the allocator, so just use the // default heap allocator, it will just allocate ByteBuffers from heap but wrapped by an ByteBuff. public static final ByteBuffAllocator HEAP = ByteBuffAllocator.createOnHeap(); {code} Almost all of the heap allocation happen in the HEAP, which means the heap allocation ratio caculated from the rpc ByteBuffAllocator will be not accurate. Will prepare a patch to address this minor bug. -- This message was sent by Atlassian JIRA (v7.6.3#76005)