@Override
  public void clear() {
    schemaEngineStatistics.releaseMemory(memoryUsage.get());
    schemaEngineStatistics.deleteMeasurement(measurementNumber.get());
    schemaEngineStatistics.deleteView(viewNumber.get());
    schemaEngineStatistics.deleteDevice(devicesNumber.get());
    memoryUsage.getAndSet(0);
    measurementNumber.getAndSet(0);
    devicesNumber.getAndSet(0);
    viewNumber.getAndAdd(0);
    templateUsage.forEach(
        (templateId, cnt) -> schemaEngineStatistics.deactivateTemplate(templateId, cnt));
    templateUsage.clear();
  }
This class is used to record statistics within the SchemaRegion in Memory mode.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaRegionStatistics.java