@SuppressWarnings("squid:S3518")
  private void initSchemaMemoryAllocate(
      MemoryManager schemaEngineMemoryManager, TrimProperties properties) {
    long schemaMemoryTotal = schemaEngineMemoryManager.getTotalMemorySizeInBytes();
    int[] schemaMemoryProportion = new int[] {5, 4, 1};
    String schemaMemoryPortionInput =
        properties.getProperty(
            "schema_memory_proportion",
            properties.getProperty("schema_memory_allocate_proportion"));
    if (schemaMemoryPortionInput != null) {
      String[] proportions = schemaMemoryPortionInput.split(":");
      int loadedProportionSum = 0;
      for (String proportion : proportions) {
        loadedProportionSum += Integer.parseInt(proportion.trim());
      }

      if (loadedProportionSum != 0) {
        for (int i = 0; i < schemaMemoryProportion.length; i++) {
          schemaMemoryProportion[i] = Integer.parseInt(proportions[i].trim());
        }
      }
    }

    int proportionSum = 0;
    for (int proportion : schemaMemoryProportion) {
      proportionSum += proportion;
    }

    schemaRegionMemoryManager =
        schemaEngineMemoryManager.getOrCreateMemoryManager(
            "SchemaRegion", schemaMemoryTotal * schemaMemoryProportion[0] / proportionSum);
    schemaCacheMemoryManager =
        schemaEngineMemoryManager.getOrCreateMemoryManager(
            "SchemaCache", schemaMemoryTotal * schemaMemoryProportion[1] / proportionSum);
    partitionCacheMemoryManager =
        schemaEngineMemoryManager.getOrCreateMemoryManager(
            "PartitionCache", schemaMemoryTotal * schemaMemoryProportion[2] / proportionSum);

    LOGGER.info(
        "allocateMemoryForSchemaRegion = {}",
        schemaRegionMemoryManager.getTotalMemorySizeInBytes());
    LOGGER.info(
        "allocateMemoryForSchemaCache = {}", schemaCacheMemoryManager.getTotalMemorySizeInBytes());
    LOGGER.info(
        "allocateMemoryForPartitionCache = {}",
        partitionCacheMemoryManager.getTotalMemorySizeInBytes());
  }
The memory manager of direct Buffer
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java