public long getUsedMemorySizeInBytes() {
    long memorySize =
        allocatedMemoryBlocks.values().stream().mapToLong(IMemoryBlock::getUsedMemoryInBytes).sum();
    for (MemoryManager child : children.values()) {
      memorySize += child.getUsedMemorySizeInBytes();
    }
    return memorySize;
  }
Get actual used memory size in bytes of memory manager
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/memory/MemoryManager.java