memory-stats.3valkey - Man Page
Returns details about memory usage.
Synopsis
MEMORY STATS
Description
The MEMORY STATS
command returns an @array-reply about the memory usage of the server.
The information about memory usage is provided as metrics and their respective values. The following metrics are reported:
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 (seeINFO
’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.main
andoverhead.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.buffer
and 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.bytes
andkeys.count
dataset.bytes
: The size in bytes of the dataset, i.e.overhead.total
subtracted fromtotal.allocated
(seeINFO
’sused_memory_dataset
)dataset.percentage
: The percentage ofdataset.bytes
out of the total memory usagepeak.percentage
: The percentage oftotal.allocated
out ofpeak.allocated
allocator.allocated
: SeeINFO
’sallocator_allocated
allocator.active
: SeeINFO
’sallocator_active
allocator.resident
: SeeINFO
’sallocator_resident
allocator.muzzy
: SeeINFO
’sallocator_muzzy
allocator-fragmentation.ratio
: SeeINFO
’sallocator_frag_ratio
allocator-fragmentation.bytes
: SeeINFO
’sallocator_frag_bytes
allocator-rss.ratio
: SeeINFO
’sallocator_rss_ratio
allocator-rss.bytes
: SeeINFO
’sallocator_rss_bytes
rss-overhead.ratio
: SeeINFO
’srss_overhead_ratio
rss-overhead.bytes
: SeeINFO
’srss_overhead_bytes
fragmentation
: SeeINFO
’smem_fragmentation_ratio
fragmentation.bytes
: SeeINFO
’smem_fragmentation_bytes
A note about the word slave used in this man page: If not for Redis OSS compatibility, the Valkey project does not use the word slave. Unfortunately in this command the word slave is part of the protocol, so we’ll be able to remove such occurrences only when this API will be naturally deprecated.
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.
Complexity
O(1)
Acl Categories
@slow
History
- Available since: 4.0.0
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), 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)