public void releaseMemory(final long size) {
    memoryBlock.release(size);
    if (memoryBlock.getUsedMemoryInBytes() < memoryBlock.getTotalMemorySizeInBytes()) {
      synchronized (allowToCreateNewSeriesLock) {
        if (!allowToCreateNewSeries
            && memoryBlock.getUsedMemoryInBytes() < memoryBlock.getTotalMemorySizeInBytes()) {
          if (needLog) {
            logger.info(
                "Current series memory {} come back to normal level, total series number is {}.",
                memoryBlock.getUsedMemoryInBytes(),
                totalMeasurementNumber.get() + totalViewNumber.get());
          } else {
            logger.debug(
                "Current series memory {} come back to normal level, total series number is {}.",
                memoryBlock.getUsedMemoryInBytes(),
                totalMeasurementNumber.get() + totalViewNumber.get());
          }
          allowToCreateNewSeries = true;
        }
      }
    }
  }
This class is used to record the global statistics of SchemaEngine in Memory mode.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java