public void removeTimePartitionInfo(DataRegionId dataRegionId) {
    synchronized (timePartitionInfoMap) {
      Map<Long, TimePartitionInfo> timePartitionInfoMapForRegion =
          timePartitionInfoMap.remove(dataRegionId);
      if (timePartitionInfoMapForRegion != null) {
        for (TimePartitionInfo timePartitionInfo : timePartitionInfoMapForRegion.values()) {
          if (timePartitionInfo != null) {
            timePartitionInfoMemoryBlock.release(timePartitionInfo.memSize);
          }
        }
      }
    }
  }
Manage all the time partitions for all data regions and control the total memory of them
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/memory/TimePartitionManager.java