Skip to content

Update graph.memory.md #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
36 changes: 17 additions & 19 deletions commands/graph.memory.md
Original file line number Diff line number Diff line change
@@ -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 <graph_id> [SAMPLES <count>]`
- graph_id: ID of the target graph.
- SAMPLES <count> (optional): Number of entities to sample for estimation (default: 100).

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

```sh
```
127.0.0.1:6379> GRAPH.MEMORY USAGE flights
1) "total_graph_sz_mb"
2) (integer) 1086
Expand All @@ -43,7 +42,7 @@ Usage: `GRAPH.MEMORY USAGE <graph_id> [SAMPLES <count>]`

## 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 |
|:-------------------------------|:--------|:---------------------------------------------------|
Expand All @@ -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. |