This commit is contained in:
Alex Cope 2023-06-29 13:41:34 -07:00 committed by Malavan Sotheeswaran
parent 22d5ce41f3
commit 1dc5ea40f3

View File

@ -2315,11 +2315,13 @@ void cronUpdateMemoryStats() {
g_pserver->cron_malloc_stats.allocator_allocated = g_pserver->cron_malloc_stats.zmalloc_used; g_pserver->cron_malloc_stats.allocator_allocated = g_pserver->cron_malloc_stats.zmalloc_used;
#ifdef __linux__ #ifdef __linux__
struct sysinfo sysinf; if (g_pserver->force_eviction_percent) {
memset(&sysinf, 0, sizeof sysinf); struct sysinfo sysinf;
if (!sysinfo(&sysinf)) { memset(&sysinf, 0, sizeof sysinf);
g_pserver->cron_malloc_stats.sys_total = static_cast<size_t>(sysinf.totalram); if (!sysinfo(&sysinf)) {
g_pserver->cron_malloc_stats.sys_free = static_cast<size_t>(sysinf.freeram); g_pserver->cron_malloc_stats.sys_total = static_cast<size_t>(sysinf.totalram);
g_pserver->cron_malloc_stats.sys_free = static_cast<size_t>(sysinf.freeram);
}
} }
#endif #endif