From c9c37336b5240cfec25fb62759372f01911e7699 Mon Sep 17 00:00:00 2001 From: Sher Sun Date: Tue, 30 Apr 2024 19:25:50 +0000 Subject: [PATCH] fix2 Signed-off-by: Sher Sun --- src/server.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/server.c b/src/server.c index 6d4dc46fe4..3702b3bc17 100644 --- a/src/server.c +++ b/src/server.c @@ -5682,6 +5682,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { long long memory_lua = evalMemory(); long long memory_functions = functionsMemory(); struct serverMemOverhead *mh = getMemoryOverheadData(); + char mem_allocator[64] = ZMALLOC_LIB; /* Peak memory is updated from time to time by serverCron() so it * may happen that the instantaneous value is slightly bigger than @@ -5757,11 +5758,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { "mem_overhead_db_hashtable_rehashing:%zu\r\n", mh->overhead_db_hashtable_rehashing, "active_defrag_running:%d\r\n", server.active_defrag_running, "lazyfree_pending_objects:%zu\r\n", lazyfreeGetPendingObjectsCount(), -#if defined(USE_JEMALLOC) - "defrag_supported: %s\r\n", "yes", -#else - "defrag_supported: %s\r\n", "no", -#endif + "defrag_supported: %s\r\n", (mem_allocator[0]=='j') ? "yes" : "no", "lazyfreed_objects:%zu\r\n", lazyfreeGetFreedObjectsCount())); freeMemoryOverheadData(mh); }