public synchronized void release(PipeMemoryBlock block) {
    if (!PIPE_MEMORY_MANAGEMENT_ENABLED || block == null || block.isReleased()) {
      return;
    }

    allocatedBlocks.remove(block);
    memoryBlock.release(block.getMemoryUsageInBytes());
    if (block instanceof PipeTabletMemoryBlock) {
      usedMemorySizeInBytesOfTablets -= block.getMemoryUsageInBytes();
    }
    if (block instanceof PipeTsFileMemoryBlock) {
      usedMemorySizeInBytesOfTsFiles -= block.getMemoryUsageInBytes();
    }
    block.markAsReleased();

    this.notifyAll();
  }
Allocate a {@link PipeMemoryBlock} for pipe only if memory used after allocation is less than
the specified threshold.

@param sizeInBytes size of memory needed to allocate
@param usedThreshold proportion of memory used, ranged from 0.0 to 1.0
@return {@code null} if the proportion of memory used after allocation exceeds {@code
    usedThreshold}. Will return a memory block otherwise.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryManager.java