Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/graph.info.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >
parent: "Commands"
---

# GRAPH.INFO [Section [Section ...]]
# GRAPH.INFO

Returns information and statistics about the current executing commands.

Expand Down
56 changes: 56 additions & 0 deletions commands/graph.memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
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.

This information is useful for debugging, monitoring, and optimizing graph workloads in FalkorDB deployments.
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.

This information is useful for debugging, monitoring, and optimizing graph workloads in FalkorDB deployments.

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.


Usage: `GRAPH.MEMORY USAGE <graph_id> [SAMPLES <count>]`

```sh
127.0.0.1:6379> GRAPH.MEMORY USAGE flights
1) "total_graph_sz_mb"
2) (integer) 1086
3) "label_matrices_sz_mb"
4) (integer) 96
5) "relation_matrices_sz_mb"
6) (integer) 64
7) "amortized_node_storage_sz_mb"
8) (integer) 120
9) "amortized_edge_storage_sz_mb"
10) (integer) 54
11) "indices_sz_mb"
12) (integer) 752
```

## Output

The command returns an array of key-value pairs, where each pair represents a specific memory metric and its value (in MB).

| Metric Name | Type | Description |
|:-------------------------------|:--------|:---------------------------------------------------|
| `total_graph_sz_mb` | integer | Total memory consumed by the graph. |
| `label_matrices_sz_mb` | integer | Amount of memory used for node labels tracking. |
| `relation_matrices_sz_mb` | integer | Amount of memory used for graph topology tracking. |
| `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. |