diff --git a/src/server.c b/src/server.c index 0d5280521d..6e7f31c5ea 100644 --- a/src/server.c +++ b/src/server.c @@ -5682,8 +5682,11 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { long long memory_lua = evalMemory(); long long memory_functions = functionsMemory(); struct serverMemOverhead *mh = getMemoryOverheadData(); - unsigned char mem_allocator[64] = ZMALLOC_LIB; - +#if defined(USE_JEMALLOC) + char defrag_supported[] = "yes"; +#else + char defrag_supported[] = "no"; +#endif /* Peak memory is updated from time to time by serverCron() so it * may happen that the instantaneous value is slightly bigger than * the peak value. This may confuse users, so we update the peak @@ -5758,8 +5761,8 @@ 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(), - "defrag_supported: %s\r\n", (mem_allocator[0]=='j') ? "yes" : "no", - "lazyfreed_objects:%zu\r\n", lazyfreeGetFreedObjectsCount())); + "lazyfreed_objects:%zu\r\n", lazyfreeGetFreedObjectsCount(), + "defrag_supported: %s\r\n", defrag_supported)); freeMemoryOverheadData(mh); }