public long getTotalCostOfActiveMemTables() {
    List<MemTableInfo> memTableInfos = activeOrPinnedMemTables();
    long totalCost = 0;
    for (MemTableInfo memTableInfo : memTableInfos) {
      // flushed memTables are not active
      if (memTableInfo.isFlushed()) {
        continue;
      }
      totalCost += memTableInfo.getWalDiskUsage();
    }

    return totalCost;
  }
Get total cost of active memTables.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/checkpoint/CheckpointManager.java