MEMORY-STATS(3valkey)
π MEMORY-STATS β the valkey manual page, but make it a group chat π
okay bestie, so you know how I'm literally always the one asking "how much memory are we using tho" π β this is the page for MEMORY STATS, from the Valkey Command Manual (that's the 3valkey manual section, iykyk). it's giving "let me read the receipts of your RAM" and honestly? iconic.
β¨ NAME β¨
memory-stats β Returns details about memory usage.
like. it tells you stuff about the memory. that's the whole vibe. π§
πΈ SYNOPSIS πΈ
MEMORY STATS
no arguments, no drama, no notes. just say it and it answers. π
π¦ DESCRIPTION π¦
so MEMORY STATS returns an @array-reply about the memory usage of the server. it's basically the server opening its notes app and reading you every metric it tracks about its own memory, with the value right next to it. main character energy fr fr. π
here's the full rundown of the metrics it reports β and bestie, I'm not skipping a single one, every last byte matters:
peak.allocated: Peak memory consumed by Valkey in bytes (seeINFOβsused_memory_peak)total.allocated: Total number of bytes allocated by Valkey using its allocator (seevalkey-info(7)INFOβsused_memory)startup.allocated: Initial amount of memory consumed by Valkey at startup in bytes (seeINFOβsused_memory_startup)replication.backlog: Size in bytes of the replication backlog (seeINFOβsrepl_backlog_active)clients.slaves: The total size in bytes of all replicas overheads (output and query buffers, connection contexts)clients.normal: The total size in bytes of all clients overheads (output and query buffers, connection contexts)cluster.links: Memory usage by cluster links (seeINFOβsmem_cluster_links).aof.buffer: The summed size in bytes of AOF related buffers.lua.caches: the summed size in bytes of the overheads of the Lua scriptsβ cachesfunctions.caches: the summed size in bytes of the overheads of the Function scriptsβ cachesdbXXX: For each of the serverβs databases, the overheads of the main and expiry dictionaries (overhead.hashtable.mainandoverhead.hashtable.expires, respectively) are reported in bytesoverhead.db.hashtable.lut: Total overhead of dictionary buckets in databases (Added in Valkey 8.0)overhead.db.hashtable.rehashing: Temporary memory overhead of database dictionaries currently being rehashed (Added in Valkey 8.0)overhead.total: The sum of all overheads, i.e.startup.allocated,replication.backlog,clients.slaves,clients.normal,aof.bufferand those of the internal data structures that are used in managing the Valkey keyspace (seeINFOβsused_memory_overhead)db.dict.rehashing.count: Number of DB dictionaries currently being rehashed (Added in Valkey 8.0)keys.count: The total number of keys stored across all databases in the serverkeys.bytes-per-key: The ratio betweendataset.bytesandkeys.countdataset.bytes: The size in bytes of the dataset, i.e.overhead.totalsubtracted fromtotal.allocated(seeINFOβsused_memory_dataset)dataset.percentage: The percentage ofdataset.bytesout of the total memory usagepeak.percentage: The percentage oftotal.allocatedout ofpeak.allocatedallocator.allocated: SeeINFOβsallocator_allocatedallocator.active: SeeINFOβsallocator_activeallocator.resident: SeeINFOβsallocator_residentallocator.muzzy: SeeINFOβsallocator_muzzyallocator-fragmentation.ratio: SeeINFOβsallocator_frag_ratioallocator-fragmentation.bytes: SeeINFOβsallocator_frag_bytesallocator-rss.ratio: SeeINFOβsallocator_rss_ratioallocator-rss.bytes: SeeINFOβsallocator_rss_bytesrss-overhead.ratio: SeeINFOβsrss_overhead_ratiorss-overhead.bytes: SeeINFOβsrss_overhead_bytesfragmentation: SeeINFOβsmem_fragmentation_ratiofragmentation.bytes: SeeINFOβsmem_fragmentation_bytes
β οΈ a note about the word slave used in this man page: If not for backward compatibility, the Valkey project no longer uses the words βmasterβ and βslaveβ. Unfortunately in the given commands these words are part of the protocol, so weβll be able to remove such occurrences only when this API will be naturally deprecated.
like, they're keeping it only for backwards compat, and the second that API gets deprecated it's getting yeeted. no cap. π«Ά
π REPLY π
RESP2
valkey-protocol(7) Array reply: a nested list of memory usage metrics and their values.
RESP3
valkey-protocol(7) Map reply: memory usage metrics and their values.
same info, different wrapping β RESP3 said "let me make it a map, prettier" and honestly? slay. π
π COMPLEXITY π
constant time. it does not care how much stuff you have. it's just that girl. β
π ACL CATEGORIES π
@slow
π°οΈ HISTORY π°οΈ
- Available since: 4.0.0
she's been here since 4.0.0 and she's still serving. π
π₯ SEE ALSO π₯
acl(3valkey), acl-cat(3valkey), acl-deluser(3valkey), acl-dryrun(3valkey), acl-genpass(3valkey), acl-getuser(3valkey), acl-help(3valkey), acl-list(3valkey), acl-load(3valkey), acl-log(3valkey), acl-save(3valkey), acl-setuser(3valkey), acl-users(3valkey), acl-whoami(3valkey), bgrewriteaof(3valkey), bgsave(3valkey), command(3valkey), command-count(3valkey), command-docs(3valkey), command-getkeys(3valkey), command-getkeysandflags(3valkey), command-help(3valkey), command-info(3valkey), command-list(3valkey), commandlog(3valkey), commandlog-get(3valkey), commandlog-help(3valkey), commandlog-len(3valkey), commandlog-reset(3valkey), config(3valkey), config-get(3valkey), config-help(3valkey), config-resetstat(3valkey), config-rewrite(3valkey), config-set(3valkey), dbsize(3valkey), debug(3valkey), failover(3valkey), flushall(3valkey), flushdb(3valkey), info(3valkey), lastsave(3valkey), latency(3valkey), latency-doctor(3valkey), latency-graph(3valkey), latency-help(3valkey), latency-histogram(3valkey), latency-history(3valkey), latency-latest(3valkey), latency-reset(3valkey), lolwut(3valkey), memory(3valkey), memory-doctor(3valkey), memory-help(3valkey), memory-malloc-stats(3valkey), memory-purge(3valkey), memory-usage(3valkey), module(3valkey), module-help(3valkey), module-list(3valkey), module-load(3valkey), module-loadex(3valkey), module-unload(3valkey), monitor(3valkey), psync(3valkey), replconf(3valkey), replicaof(3valkey), restore-asking(3valkey), role(3valkey), save(3valkey), shutdown(3valkey), slowlog(3valkey), slowlog-get(3valkey), slowlog-help(3valkey), slowlog-len(3valkey), slowlog-reset(3valkey), swapdb(3valkey), sync(3valkey), time(3valkey)
and that's the whole page bestie, you ate that π β¨
this was Valkey 9.0.0, dated 2025-10-21 β the MEMORY-STATS(3valkey) page from the Valkey Command Manual. go check your memory usage, queen. π«Άπ
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms