diff --git a/commands/graph.memory.md b/commands/graph.memory.md index bb2deb6..992669c 100644 --- a/commands/graph.memory.md +++ b/commands/graph.memory.md @@ -1,31 +1,30 @@ --- -title: "GRAPH.MEMORY" -description: > - The GRAPH.MEMORY command returns detailed memory usage statistics for the specified graph. - This command can be used to monitor memory consumption at the graph level, - providing insight into how much memory is used by various internal data structures such as - nodes, edges, schemas, and indices. - +Command: "GRAPH.MEMORY" +Description: > + Returns detailed memory usage statistics for a specified graph. Useful for monitoring and optimizing internal structures like nodes, edges, schemas, and indices within FalkorDB deployments. This information is useful for debugging, monitoring, and optimizing graph workloads in FalkorDB deployments. -parent: "Commands" +Parent: "Commands" --- # GRAPH.MEMORY -The GRAPH.MEMORY command returns detailed memory usage statistics for the specified graph. -This command can be used to monitor memory consumption at the graph level, -providing insight into how much memory is used by various internal data structures such as -nodes, edges, schemas, and indices. +Returns detailed memory usage metrics for a given graph. This command helps diagnose memory bottlenecks and assess storage overhead across internal components such as: + +- Label and relation matrices +- Node and edge storage +- Indices and schema allocations -This information is useful for debugging, monitoring, and optimizing graph workloads in FalkorDB deployments. +You can optionally sample a subset of graph entities to estimate usage. The default sample size is 100 entities. -The optional `SAMPLES` option can be provided, where count is the number of sampled graph entities. -The samples are averaged to estimate the total size. By default, this option is set to 100. +## Syntax +`GRAPH.MEMORY USAGE [SAMPLES ]` +- graph_id: ID of the target graph. +- SAMPLES (optional): Number of entities to sample for estimation (default: 100). -Usage: `GRAPH.MEMORY USAGE [SAMPLES ]` +## Example -```sh +``` 127.0.0.1:6379> GRAPH.MEMORY USAGE flights 1) "total_graph_sz_mb" 2) (integer) 1086 @@ -43,7 +42,7 @@ Usage: `GRAPH.MEMORY USAGE [SAMPLES ]` ## Output -The command returns an array of key-value pairs, where each pair represents a specific memory metric and its value (in MB). +The command returns an array of key-value pairs, each representing a specific memory metric and its value (in MB). | Metric Name | Type | Description | |:-------------------------------|:--------|:---------------------------------------------------| @@ -53,4 +52,3 @@ The command returns an array of key-value pairs, where each pair represents a sp | `amortized_node_storage_sz_mb` | integer | Amount of memory used for nodes storage. | | `amortized_edge_storage_sz_mb` | integer | Amount of memory used for relationships storage. | | `indices_sz_mb` | integer | Amount of memory consumed by indices. | -