xinyiZzz commented on code in PR #47462: URL: https://github.com/apache/doris/pull/47462#discussion_r1966807314
########## be/src/runtime/query_context.cpp: ########## @@ -146,34 +151,45 @@ QueryContext::QueryContext(TUniqueId query_id, ExecEnv* exec_env, void QueryContext::_init_query_mem_tracker() { bool has_query_mem_limit = _query_options.__isset.mem_limit && (_query_options.mem_limit > 0); - int64_t _bytes_limit = has_query_mem_limit ? _query_options.mem_limit : -1; - if (_bytes_limit > MemInfo::mem_limit()) { - VLOG_NOTICE << "Query memory limit " << PrettyPrinter::print(_bytes_limit, TUnit::BYTES) + int64_t bytes_limit = has_query_mem_limit ? _query_options.mem_limit : -1; + if (bytes_limit > MemInfo::mem_limit() || bytes_limit == -1) { + VLOG_NOTICE << "Query memory limit " << PrettyPrinter::print(bytes_limit, TUnit::BYTES) << " exceeds process memory limit of " << PrettyPrinter::print(MemInfo::mem_limit(), TUnit::BYTES) - << ". Using process memory limit instead"; - _bytes_limit = MemInfo::mem_limit(); + << " OR is -1. Using process memory limit instead."; + bytes_limit = MemInfo::mem_limit(); + } + // If the query is a pure load task(streamload, routine load, group commit), then it should not use + // memlimit per query to limit their memory usage. + if (is_pure_load_task()) { Review Comment: 现在也不支持限制单个 Load 任务的 memtable 内存大小,那限制 Load 任务的内存只能用 Workload Group 了吧 用户线上经常出现各种类型的导入任务把内存打满。 ########## be/src/runtime/query_context.cpp: ########## @@ -146,34 +151,45 @@ QueryContext::QueryContext(TUniqueId query_id, ExecEnv* exec_env, void QueryContext::_init_query_mem_tracker() { bool has_query_mem_limit = _query_options.__isset.mem_limit && (_query_options.mem_limit > 0); - int64_t _bytes_limit = has_query_mem_limit ? _query_options.mem_limit : -1; - if (_bytes_limit > MemInfo::mem_limit()) { - VLOG_NOTICE << "Query memory limit " << PrettyPrinter::print(_bytes_limit, TUnit::BYTES) + int64_t bytes_limit = has_query_mem_limit ? _query_options.mem_limit : -1; + if (bytes_limit > MemInfo::mem_limit() || bytes_limit == -1) { + VLOG_NOTICE << "Query memory limit " << PrettyPrinter::print(bytes_limit, TUnit::BYTES) << " exceeds process memory limit of " << PrettyPrinter::print(MemInfo::mem_limit(), TUnit::BYTES) - << ". Using process memory limit instead"; - _bytes_limit = MemInfo::mem_limit(); + << " OR is -1. Using process memory limit instead."; + bytes_limit = MemInfo::mem_limit(); + } + // If the query is a pure load task(streamload, routine load, group commit), then it should not use + // memlimit per query to limit their memory usage. + if (is_pure_load_task()) { Review Comment: 现在也不支持限制单个 Load 任务的 memtable 内存大小,那限制 Load 任务的内存只能用 Workload Group 了吧 用户线上经常出现各种类型的导入任务把内存打满。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org