@Override
  public void deallocate(ByteBuffer buffer) {
    synchronized (lock) {
      availableMemory += buffer.capacity();
      if (availableMemory > capacity) {
        availableMemory = capacity;
        logger.warn("The total deallocated memory is more than that had been allocated from the buffer pool.");
      }
      lock.notify();
    }
  }
This method claims back the memory of {@code buffer}. It does not
check if the buffer was originally allocated from the pool. If a
deallocation will exceed the pool's capacity, the method simply sets
the pool's available memory to its {@code capacity}.
@param buffer the {@link ByteBuffer} to be deallocated back to the pool
ambry-utils/src/main/java/com/github/ambry/utils/SimpleByteBufferPool.java