public synchronized void clearAll() {
    // release the child memory managers
    for (MemoryManager child : children.values()) {
      child.clearAll();
    }
    children.clear();
    // release the memory blocks
    for (IMemoryBlock block : allocatedMemoryBlocks.values()) {
      if (block == null || block.isReleased()) {
        continue;
      }

      block.markAsReleased();
      allocatedMemorySizeInBytes -= block.getTotalMemorySizeInBytes();

      try {
        block.close();
      } catch (Exception e) {
        LOGGER.error("releaseWithOutNotify: failed to close memory block", e);
      }
    }
    allocatedMemoryBlocks.clear();
  }
Clear all memory blocks and child memory managers
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/MemoryManager.java