Error: the 'memory'' command is not supported in the redis instance

What's Causing This Error

The error message 'the 'memory'' command is not supported in the redis instance' occurs when a user attempts to execute the Redis MEMORY command on a Redis instance that does not support it. The MEMORY command is used to provide information about Redis memory usage and can be used to analyze memory consumption of Redis keys.

This error occurs when the Redis version being used is older than 4.0, as the MEMORY command was introduced in Redis 4.0. Therefore, if you attempt to use the MEMORY command on an old Redis instance, you will get this error message.

Solution - Here's How To Resolve It

To resolve this issue, you can upgrade your Redis instance to version 4.0 or later, which supports the MEMORY command. Alternatively, you can use other commands such as INFO and OBJECT to obtain information about Redis memory usage.

If upgrading to Redis version 4.0 or later is not feasible for any reason, another option is to use a third-party tool like Redis Commander or reds, which provides a graphical interface for Redis and avoids the need to use the MEMORY command directly. However, these tools may have their own limitations, so it's important to evaluate them before choosing to use them.

Was this content helpful?

Start building today

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.