This commit is contained in:
Alex Cope 2023-06-30 10:45:19 -07:00 committed by Malavan Sotheeswaran
parent e3cdc765a1
commit 4c0cf9e5cd

View File

@ -626,16 +626,10 @@ static unsigned long evictionTimeLimitUs() {
}
static void updateSysFreeMemory() {
#ifdef __linux__
if (g_pserver->force_eviction_percent) {
struct sysinfo sysinf;
memset(&sysinf, 0, sizeof sysinf);
if (!sysinfo(&sysinf)) {
g_pserver->cron_malloc_stats.sys_free = static_cast<size_t>(sysinf.freeram);
g_pserver->cron_malloc_stats.sys_available = getMemAvailable();
}
}
#endif
}
/* Check that memory usage is within the current "maxmemory" limit. If over
* "maxmemory", attempt to free memory by evicting data (if it's safe to do so).