Hi,
I have Redis instance of which max memory set as 45GB, Used memory is around 40GB and Peak memory usage is 42 GB but RSS is way too high 80 GB.
Is there any way to release this memory.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
76829 root 20 0 95.3g 80g 1328 R 56.4 63.8 29424:59 redis-server
Memory
used_memory:41960888496 used_memory_human:39.08G used_memory_rss:86287454208 used_memory_rss_human:80.36G used_memory_peak:46040101560 used_memory_peak_human:42.88G total_system_memory:135211622400 total_system_memory_human:125.93G used_memory_lua:37888 used_memory_lua_human:37.00K maxmemory:48318382080 maxmemory_human:45.00G maxmemory_policy:allkeys-lru mem_fragmentation_ratio:2.06 mem_allocator:jemalloc-4.0.3
Comment From: charsyam
Hi, @pankaj139 Actually, Redis Max-memory setting can't check rss, it can only check used_memory. It is because that redis can't control memory allocation. redis depends on jemalloc. so, Your situation can happen easily.
Comment From: pankaj139
@charsyam Is there any way to avoid this situation?
Comment From: charsyam
@pankaj139 There is no 100 % guaranteed way. In my experiences 1] Reducing Memory Fragmentation. -> Don't use variable size of data.
2] Migration to other server using replication. -> Like restarting
Comment From: smartlee
@pankaj139 have u solved the issue? I encounter the same problem
Comment From: pankaj139
@smartlee No. But to get rid of this I restarted the Redis server and kept my object size less than 4kb to occur this in future.