How to get redis memory usage through java. For example im getting the dbsize of redis through Jedis java class, using the ethod dbsize() method in that jedis class. Is there any similar method for getting the memory usage? Thanks in Advance.
You can collect all memory utilization metrics data for a Redis instance by running “info memory”.
Redis is a remote data structure server. It is certainly slower than just storing the data in local memory (since it involves socket roundtrips to fetch/store the data).
Performance. All Redis data resides in memory, which enables low latency and high throughput data access. Unlike traditional databases, In-memory data stores don't require a trip to disk, reducing engine latency to microseconds.
To get memory used my Redis, you can run the INFO command. It will give you a lot of useless info, but somewhere in there will be used_memory and used_memory_human
root@this:~# redis-cli
redis> info
redis_version:2.2.4
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:32
...
used_memory:551084
used_memory_human:538.17K
used_memory_rss:1249280
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With