MEMORY PURGE
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.
Return value
Section titled “Return value”Simple string OK in RESP2 and RESP3.
Examples
Section titled “Examples”127.0.0.1:6379> MEMORY PURGEOKCompatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.