Skip to main content
The GRAPH.MEMORY command returns detailed memory consumption statistics for a specific graph in megabytes (MB). It provides insight into how much memory is used by various internal data structures such as nodes, edges, schemas, indices, and matrix representations. This command can be used to monitor memory consumption at the graph level, making it especially useful for debugging, monitoring, performance optimization, and capacity planning in FalkorDB deployments.

Syntax

Arguments

Return

The command returns a set of key-value pairs, where each pair represents a specific memory metric and its value (in MB), corresponding to different components of the graph. In RESP2, this is encoded as a flat array of alternating field names and values:

Examples

Basic Usage

With Sampling

Sample Output

Frequently Asked Questions

All memory values are reported in megabytes (MB).
The SAMPLES parameter controls how many samples are taken when estimating memory usage. Higher values improve accuracy but increase computation time. The default is 100, and valid range is 1 to 10000.
The total_graph_sz_mb metric gives the total memory consumed by the graph. For more detailed analysis, examine per-label and per-relationship-type breakdowns to identify which parts of your graph use the most memory.
Indexes store additional data structures for fast lookups. If you have many indexes or indexes on high-cardinality properties, the index memory can be significant. Only create indexes that are actually used by your queries.
Yes, but be aware that higher SAMPLES values increase computation time. Use a moderate sample count for routine monitoring and higher counts only for detailed analysis during maintenance windows.