private void freeUp(int size) {
        while (!this.free.isEmpty() && this.nonPooledAvailableMemory < size)
            this.nonPooledAvailableMemory += this.free.pollLast().capacity();
    }
Attempt to ensure we have at least the requested number of bytes of memory for allocation by deallocating pooled
buffers (if needed)
clients/src/main/java/org/apache/kafka/clients/producer/internals/BufferPool.java