fix
This commit is contained in:
parent
4b72775a5c
commit
1d53d8b75a
@ -429,13 +429,13 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
|
|||||||
maxmemory = static_cast<size_t>(maxmemory*1.2);
|
maxmemory = static_cast<size_t>(maxmemory*1.2);
|
||||||
|
|
||||||
/* If available system memory is below a certain threshold, force eviction */
|
/* If available system memory is below a certain threshold, force eviction */
|
||||||
long sys_available_mem_buffer = 0;
|
long long sys_available_mem_buffer = 0;
|
||||||
if (g_pserver->force_eviction_percent && g_pserver->cron_malloc_stats.sys_total) {
|
if (g_pserver->force_eviction_percent && g_pserver->cron_malloc_stats.sys_total) {
|
||||||
float available_mem_ratio = (float)(100 - g_pserver->force_eviction_percent)/100;
|
float available_mem_ratio = (float)(100 - g_pserver->force_eviction_percent)/100;
|
||||||
size_t min_available_mem = static_cast<size_t>(g_pserver->cron_malloc_stats.sys_total * available_mem_ratio);
|
size_t min_available_mem = static_cast<size_t>(g_pserver->cron_malloc_stats.sys_total * available_mem_ratio);
|
||||||
sys_available_mem_buffer = static_cast<long>(g_pserver->cron_malloc_stats.sys_available - min_available_mem);
|
sys_available_mem_buffer = static_cast<long>(g_pserver->cron_malloc_stats.sys_available - min_available_mem);
|
||||||
if (sys_available_mem_buffer < 0) {
|
if (sys_available_mem_buffer < 0) {
|
||||||
long mem_threshold = mem_reported + sys_available_mem_buffer;
|
long long mem_threshold = mem_reported + sys_available_mem_buffer;
|
||||||
maxmemory = ((long)maxmemory < mem_threshold) ? maxmemory : static_cast<size_t>(mem_threshold);
|
maxmemory = ((long)maxmemory < mem_threshold) ? maxmemory : static_cast<size_t>(mem_threshold);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user