public void updateAfterFlushing(
      DataRegionId dataRegionId,
      long timePartitionId,
      long systemFlushTime,
      long memSize,
      boolean isActive) {
    synchronized (timePartitionInfoMap) {
      TimePartitionInfo timePartitionInfo =
          timePartitionInfoMap
              .computeIfAbsent(dataRegionId, k -> new TreeMap<>())
              .get(timePartitionId);
      if (timePartitionInfo != null) {
        timePartitionInfo.lastSystemFlushTime = systemFlushTime;
        timePartitionInfoMemoryBlock.forceAllocateWithoutLimitation(
            memSize - timePartitionInfo.memSize);
        timePartitionInfo.memSize = memSize;
        timePartitionInfo.isActive = isActive;
        if (timePartitionInfoMemoryBlock.getUsedMemoryInBytes()
            > timePartitionInfoMemoryBlock.getTotalMemorySizeInBytes()) {
          degradeLastFlushTime();
        }
      }
    }
  }
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