synchronized void forceResize(LoadTsFileMemoryBlock memoryBlock, long newSizeInBytes)
      throws LoadRuntimeOutOfMemoryException {
    if (memoryBlock.getTotalMemorySizeInBytes() >= newSizeInBytes) {

      if (memoryBlock.getMemoryUsageInBytes() > newSizeInBytes) {
        LOGGER.error(
            "Load: Failed to setTotalMemorySizeInBytes memory block {} to {} bytes, current memory usage {} bytes",
            memoryBlock,
            newSizeInBytes,
            memoryBlock.getMemoryUsageInBytes());
      }

      releaseToQuery(memoryBlock.getTotalMemorySizeInBytes() - newSizeInBytes);
      memoryBlock.setTotalMemorySizeInBytes(newSizeInBytes);
      return;
    }

    long bytesNeeded = newSizeInBytes - memoryBlock.getTotalMemorySizeInBytes();
    try {
      forceAllocateFromQuery(bytesNeeded);
      if (LOGGER.isDebugEnabled()) {
        LOGGER.info(
            "Load: Force resized LoadTsFileMemoryBlock with memory from query engine, size added: {}, new size: {}",
            bytesNeeded,
            newSizeInBytes);
      }
    } catch (LoadRuntimeOutOfMemoryException e) {
      if (dataCacheMemoryBlock != null && dataCacheMemoryBlock.doShrink(bytesNeeded)) {
        LOGGER.info(
            "Load: Query engine's memory is not sufficient, force resized LoadTsFileMemoryBlock with memory from DataCacheMemoryBlock, size added: {}, new size: {}",
            bytesNeeded,
            newSizeInBytes);
        usedMemorySizeInBytes.addAndGet(bytesNeeded);
      } else {
        throw e;
      }
    }
    memoryBlock.setTotalMemorySizeInBytes(newSizeInBytes);
  }
Resize the memory block to the new size.

@throws LoadRuntimeOutOfMemoryException if failed to allocate enough memory
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/memory/LoadTsFileMemoryManager.java