查看redis内存占用信息

info memory
附带_human的属性为可视化属性

localhost:6379> info memory
# Memory
used_memory:2916608
used_memory_human:2.78M
used_memory_rss:2879680
used_memory_rss_human:2.75M
used_memory_peak:3837776
used_memory_peak_human:3.66M
total_system_memory:0
total_system_memory_human:0B
used_memory_lua:36864
used_memory_lua_human:36.00K
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:0.99
mem_allocator:jemalloc-3.6.0
localhost:6379>

查看redis某一个key占用的内存大小

MEMORY USAGE
返回大小为byte

[4] > set A AAAAAAAAAAAAAAAAAAAAAAA
"OK"

[4] > MEMORY USAGE A
(integer) 68
文章目录