add checker for system_memory and memory_limit

This commit is contained in:
obdev
2022-11-10 08:37:49 +00:00
committed by wangzelin.wzl
parent d73a417102
commit 0621c4812e
13 changed files with 159 additions and 115 deletions

View File

@ -126,7 +126,8 @@ int ObServerReloadConfig::operator()()
}
}
{
const int64_t limit_memory = GCONF.get_server_memory_limit();
GMEMCONF.reload_config(GCONF);
const int64_t limit_memory = GMEMCONF.get_server_memory_limit();
const int64_t reserved_memory = GCONF.cache_wash_threshold;
const int64_t reserved_urgent_memory = GCONF.memory_reserved;
LOG_INFO("set limit memory", K(limit_memory));
@ -172,7 +173,7 @@ int ObServerReloadConfig::operator()()
const int64_t cache_size = GCONF.memory_chunk_cache_size;
const int cache_cnt = (cache_size > 0 ? cache_size : GCONF.get_server_memory_limit()) / INTACT_ACHUNK_SIZE;
const int cache_cnt = (cache_size > 0 ? cache_size : GMEMCONF.get_server_memory_limit()) / INTACT_ACHUNK_SIZE;
lib::AChunkMgr::instance().set_max_chunk_cache_cnt(cache_cnt);
if (GCONF.cluster_id.get_value() >= 0) {
obrpc::ObRpcNetHandler::CLUSTER_ID = GCONF.cluster_id.get_value();