# MEMORY

> Inspect how much memory keys and the server use, and give unused memory back to the system.

URL: https://docs.hotkv.com/commands/memory/

```
MEMORY subcommand [argument ...]
```

- Group: Server
- HotKV Cloud: all plans
- On-Premise: no license needed

`MEMORY` is a container command for memory introspection. `MEMORY HELP`
lists the subcommands.

## Subcommands

| Subcommand | What it does |
| --- | --- |
| [MEMORY USAGE](https://docs.hotkv.com/commands/memory-usage/index.md) | Estimated bytes a key and its value take. |
| [MEMORY STATS](https://docs.hotkv.com/commands/memory-stats/index.md) | A breakdown of the server's memory use. |
| [MEMORY DOCTOR](https://docs.hotkv.com/commands/memory-doctor/index.md) | A short report on memory problems, in plain English. |
| [MEMORY PURGE](https://docs.hotkv.com/commands/memory-purge/index.md) | Return freed memory to the operating system. |
| [MEMORY MALLOC-STATS](https://docs.hotkv.com/commands/memory-malloc-stats/index.md) | Allocated, peak and resident bytes as text. |

An unknown subcommand gets `ERR unknown subcommand '<name>'. Try MEMORY HELP.`

## Compatibility

Same subcommands as Redis 7 and Valkey 8. See the subcommand pages for
differences in their output.

## See also

[INFO](https://docs.hotkv.com/commands/info/index.md), [memory and eviction](https://docs.hotkv.com/operate/memory-and-eviction/index.md)