Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

MEMORY PURGE

Last updated
MEMORY PURGE
Group
Server
Arity
2 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

After many keys are deleted, expire or are evicted, the server process can keep holding memory it no longer uses, which shows as used_memory_rss well above used_memory in INFO. MEMORY PURGE asks the process to return such memory to the operating system. Whether and how much is returned depends on the platform and build; on some it has no effect.

It does not delete or move any data. FLUSHDB and FLUSHALL already do this when they finish, so you do not need MEMORY PURGE after them.

Simple string OK in RESP2 and RESP3.

127.0.0.1:6379> MEMORY PURGE
OK

Same as Redis 7 and Valkey 8.

MEMORY DOCTOR, MEMORY STATS