# ANALYZE MEMORY

Estimates peak memory usage per query.

```sql
ANALYZE MEMORY;
```

`ANALYZE MEMORY` collects details about memory usage from past query runs across leaf nodes and retrieves execution time data per query from the aggregator node(s). These results are used to calculate an estimated peak memory for each query which is added to the corresponding query entry in each node's local plancache.

The memory information collected by `ANALYZE MEMORY` is intended to help with workload management tasks such as categorizing query types and managing available memory in the cluster.

> **📝 Note**: You must have `SUPER` privileges to run the `ANALYZE MEMORY` command or an error will be generated. This command also runs in the background every 10 minutes.

***

Modified at: July 10, 2025

Source: [/db/v9.1/reference/sql-reference/operational-commands/analyze-memory/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/operational-commands/analyze-memory/)

(An index of the documentation is available at /llms.txt)
