MEMORY-PURGE(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– memory-purge β€” the "please give the RAM back" button πŸ’–

okay so hi bestie 🫢 you're reading the Valkey Command Manual page for memory-purge, which lives in manual section 3valkey. yes the command name is memory-purge even though the actual thing you type is two whole words, we'll get to that, stay with me ✨


🌸 NAME 🌸

memory-purge β€” literally just asks the allocator to release memory. that's it. that's the whole job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

MEMORY PURGE

no args, no flags, no drama. it's giving minimalism πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• the MEMORY PURGE command attempts to purge dirty pages, so that the allocator can reclaim them. it's basically the equivalent of telling your room "hey. clean yourself." and hoping it listens πŸ™ˆ

and now the part you actually need to know: this command is currently implemented only when you're using jemalloc as the allocator. for every other allocator it evaluates to a benign NOOP β€” meaning it does absolutely nothing, but politely, and it won't yell at you or error out. lowkey the chillest no-op in the whole codebase 😌

✨ REPLY ✨

valkey-protocol(7) simple string reply: OK.

that's it. OK. no payload, no extra data, just vibes 🌈


πŸ’€ COMPLEXITY πŸ’€

depends on how much memory is allocated, and it could be slow.

yeah. not "might be" slow. could be slow. if your instance is holding onto a whole lot of memory, this is not a "run it mid-request and forget about it" situation, bestie 😭 plan accordingly.


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @slow

she is literally filed under slow. the category tag said it first, don't come for me πŸŽ€


🧚 HISTORY 🧚

  • available since: 4.0.0

an icon that's been around since 4.0.0, we stan a legacy queen πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

like a group chat of related commands, all of them in (3valkey):


tl;dr bestie: type MEMORY PURGE, get OK, maybe reclaim some dirty pages if you're on jemalloc, and get literally nothing if you're not. no cap. 🫢

and that's the whole page!! this one came to you from version 9.0.0, dated 2025-10-21, in MEMORY-PURGE(3valkey) β€” tysm for reading, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from