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
What units does GRAPH.MEMORY report in?
What units does GRAPH.MEMORY report in?
What does the SAMPLES parameter do?
What does the SAMPLES parameter do?
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.What is the most useful metric for capacity planning?
What is the most useful metric for capacity planning?
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.Why might indices_sz_mb be large relative to the graph?
Why might indices_sz_mb be large relative to the graph?
Can I run GRAPH.MEMORY on a production system?
Can I run GRAPH.MEMORY on a production system?
SAMPLES values increase computation time. Use a moderate sample count for routine monitoring and higher counts only for detailed analysis during maintenance windows.