提交 f7742f72 编写于 作者: S starlord

MS-249 Check machine hardware during initialize


Former-commit-id: 874dcaa8f6000158409de2865ca28050e4ceeac3
上级 358ac006
......@@ -34,7 +34,7 @@ license_config: # license configure
cache_config: # cache configure
cpu_cache_capacity: 16 # how many memory are used as cache, unit: GB, range: 0 ~ less than total memory
cache_free_percent: 0.85 # how much memory should be free when cache is full, range: greater than zero ~ 1.0
cache_free_percent: 0.85 # old data will be erased from cache when cache is full, this value specify how much memory should be kept, range: greater than zero ~ 1.0
insert_cache_immediately: false # insert data will be load into cache immediately for hot query
engine_config:
......
......@@ -163,6 +163,9 @@ void Cache::free_memory() {
int64_t threshhold = capacity_ * freemem_percent_;
int64_t delta_size = usage_ - threshhold;
if(delta_size <= 0) {
delta_size = 1;//ensure at least one item erased
}
std::set<std::string> key_array;
int64_t released_size = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册