You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Zheng Hu (JIRA)" <ji...@apache.org> on 2019/07/20 15:32:00 UTC

[jira] [Resolved] (HBASE-22663) The HeapAllocationRatio in WebUI is not accurate because all of the heap allocation will happen in another separated allocator named HEAP

     [ https://issues.apache.org/jira/browse/HBASE-22663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zheng Hu resolved HBASE-22663.
------------------------------
      Resolution: Fixed
    Hadoop Flags: Reviewed

> 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
>            Priority: Major
>             Fix For: 3.0.0, 2.3.0
>
>
> 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.14#76016)