public void setQueryThreadCount(int queryThreadCount) {
    if (queryThreadCount <= 0) {
      queryThreadCount = Runtime.getRuntime().availableProcessors();
    }
    this.queryThreadCount = queryThreadCount;
    // TODO @spricoder: influence dynamic change of memory size
    if (getDataExchangeMemoryManager() != null) {
      this.maxBytesPerFragmentInstance =
          getDataExchangeMemoryManager().getTotalMemorySizeInBytes() / queryThreadCount;
    }
  }
The memory manager of direct Buffer
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java