Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

MEMORY DOCTOR

Last updated
MEMORY DOCTOR
Group
Server
Complexity
O(N) where N is the number of client connections
Arity
2 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

MEMORY DOCTOR looks at the server’s memory figures and reports anything that needs attention, with a hint about what to do. It checks for:

  • the process holding much more memory than it uses (for example after a peak or many deletes), with a pointer to MEMORY PURGE
  • a peak well above the current use
  • memory use close to maxmemory, and whether writes will then be refused or keys evicted, depending on maxmemory-policy
  • a client with a large backlog of replies it has not read (a slow consumer; the omem field of CLIENT LIST shows which)
  • a replication backlog that takes a large share of the memory in use

When nothing is found, it summarises memory in use, memory held by the process, and the peak.

The report as text: a bulk string in RESP2, a verbatim string (txt) in RESP3.

127.0.0.1:6379> MEMORY DOCTOR
No memory problems found. In use: 88.21M, held by the process: 101.40M, peak: 92.35M.
127.0.0.1:6379> MEMORY DOCTOR
Memory report:
- Memory in use is 93.4% of maxmemory (1.00G): writes will evict keys (allkeys-lru) once it is reached.

Redis 7 and Valkey 8 have the same command. The report’s wording and the checks it makes are HotKV’s own, so don’t parse the text.

MEMORY STATS, MEMORY PURGE, LATENCY DOCTOR, INFO