public void clean() {
    while (!buffers.isEmpty()) {
      ByteBuffer b = buffers.poll();
      if (b.isDirect()) {
        UnsafeAccess.freeDirectBuffer(b);
      }
    }
    this.usedBufCount.set(0);
    this.maxPoolSizeInfoLevelLogged = false;
    this.poolAllocationBytes.reset();
    this.heapAllocationBytes.reset();
    this.lastPoolAllocationBytes = 0;
    this.lastHeapAllocationBytes = 0;
  }
Free all direct buffers if allocated, mainly used for testing.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java