{"record":{"id":"76fbd87ce1e2dbf8","repo":"redis/redis-py","slug":"memory-doctor-is-intentionally-not-implemented-in","errorCode":null,"errorMessage":"MEMORY DOCTOR is intentionally not implemented in the client. For more information, see https://redis.io/commands/memory-doctor","messagePattern":"MEMORY DOCTOR is intentionally not implemented in the client\\. For more information, see https://redis\\.io/commands/memory-doctor","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"redis/commands/core.py","lineNumber":1868,"sourceCode":"\n    @overload\n    def object(self: SyncClientProtocol, infotype: str, key: KeyT, **kwargs) -> Any: ...\n\n    @overload\n    def object(\n        self: AsyncClientProtocol, infotype: str, key: KeyT, **kwargs\n    ) -> Awaitable[Any]: ...\n\n    def object(self, infotype: str, key: KeyT, **kwargs) -> Any | Awaitable[Any]:\n        \"\"\"\n        Return the encoding, idletime, or refcount about the key\n        \"\"\"\n        return self.execute_command(\n            \"OBJECT\", infotype, key, infotype=infotype, **kwargs\n        )\n\n    def memory_doctor(self, **kwargs) -> None:\n        raise NotImplementedError(\n            \"\"\"\n            MEMORY DOCTOR is intentionally not implemented in the client.\n\n            For more information, see https://redis.io/commands/memory-doctor\n            \"\"\"\n        )\n\n    def memory_help(self, **kwargs) -> None:\n        raise NotImplementedError(\n            \"\"\"\n            MEMORY HELP is intentionally not implemented in the client.\n\n            For more information, see https://redis.io/commands/memory-help\n            \"\"\"\n        )\n\n    @overload\n    def memory_stats(self: SyncClientProtocol, **kwargs) -> dict[str, Any]: ...","sourceCodeStart":1850,"sourceCodeEnd":1886,"githubUrl":"https://github.com/redis/redis-py/blob/6a6b581b48225afa0b76912d1028c6035baee932/redis/commands/core.py#L1850-L1886","documentation":"Raised by memory_doctor() (redis/commands/core.py:1868) which is a stub that unconditionally raises NotImplementedError. MEMORY DOCTOR emits a human-readable advisory report designed for redis-cli, so the python client does not implement it. Structured memory commands that ARE supported: memory_stats, memory_usage, memory_malloc_stats, memory_purge. No arguments are accepted.","triggerScenarios":"Calling r.memory_doctor(). Any call raises immediately.","commonSituations":"Building a memory diagnostics dashboard and reaching for the 'doctor' summary; assuming the MEMORY subcommands are fully mirrored.","solutions":["Use r.memory_stats() for a structured dict and r.memory_usage(key) for per-key sizing","Run 'redis-cli MEMORY DOCTOR' for the human-readable advisory","If required from python: r.execute_command(\"MEMORY\", \"DOCTOR\")"],"exampleFix":"# before\nr.memory_doctor()\n# after\nstats = r.memory_stats()","handlingStrategy":"fallback","validationCode":"# memory_doctor() is intentionally unimplemented; use structured APIs\ndef memory_summary(r):\n    return r.memory_stats()","typeGuard":null,"tryCatchPattern":"try:\n    r.memory_doctor()\nexcept NotImplementedError:\n    stats = r.memory_stats()","preventionTips":["Use memory_stats()/memory_usage() for programmatic data.","Reserve MEMORY DOCTOR for redis-cli.","Mark memory_doctor() as unavailable in internal docs."],"tags":["memory","notimplemented","intentional"],"backgroundTag":null,"analyzedSha":"6a6b581b48225afa0b76912d1028c6035baee932","analyzedAt":"2026-08-10T12:52:44.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}