Understanding and managing computing engine memory usage is essential for optimal performance. This page covers memory budget allocation, estimation, partial caching strategies, and troubleshooting.
The computing engine divides its memory budget into three components:
| Component | Default share | What it holds |
|---|---|---|
| Topology budget | 60% | The graph structure: outgoing- and incoming-edge indexes, per-label adjacency, node and edge ID mappings. |
| Property budget | 30% | Cached property values: per-label property arrays, string interning for text properties. |
| Working budget | 10% | Temporary memory used during query execution, algorithm runs, and cache build/rebuild operations. |
These percentages are defaults that work well for most workloads. The system automatically manages allocation within your configured limit.
Use these estimates to plan your memory allocation:
Topology Memory:
Follow the formula Memory = 2 * (N + 1) * 8 + 4 * E * 8 bytes, where N = number of nodes, E = number of edges.
The two-times factor on both terms reflects the fact that the engine maintains two parallel indexes — one for outgoing edges and one for incoming edges — so traversal in either direction is equally fast. Roughly, plan for ~16 bytes per node (one index slot in each direction) and ~32 bytes per edge (each edge appears in both indexes).
NOTEFor graphs under 2³² nodes and edges, low-memory topology uses 32-bit adjacency arrays instead of 64-bit, roughly halving these topology figures.
Property Memory:
Reference Table:
| Graph Size | Nodes | Edges | Topology | Properties (5)* | Total |
|---|---|---|---|---|---|
| Small | 1M | 10M | ~344 MB | ~80 MB | ~424 MB |
| Medium | 10M | 100M | ~3.4 GB | ~800 MB | ~4.2 GB |
| Large | 100M | 1B | ~34 GB | ~8 GB | ~42 GB |
The Properties column assumes 5 integer/float properties per node.
Calculate memory for a social network:
GQL-- Example: Social network with 5M users, 50M follows -- Topology: 2 * (5M + 1) * 8 + 4 * 50M * 8 = ~1.7 GB -- Properties (name, age, verified): ~60 MB -- Recommended limit: 2GB ALTER GRAPH socialNetwork SET COMPUTE MEMORY_LIMIT 2GB
Calculate memory for a knowledge graph:
GQL-- Example: Knowledge graph with 20M entities, 200M relations -- Topology: 2 * (20M + 1) * 8 + 4 * 200M * 8 = ~6.7 GB -- Properties (title, type): ~320 MB -- Recommended limit: 8GB ALTER GRAPH knowledgeGraph SET COMPUTE MEMORY_LIMIT 8GB
For graphs larger than available memory, the computing engine supports partial caching:
How Partial Caching Works:
Optimizing Partial Caching:
Best Practices:
Partial caching for large graphs:
GQL-- Large graph with limited memory -- Cache only the most important portion ALTER GRAPH massiveGraph SET COMPUTE ENABLED ALTER GRAPH massiveGraph SET COMPUTE MEMORY_LIMIT 16GB -- Queries will use cache when possible -- Falls back to disk for uncached nodes MATCH (popular:User WHERE popular.followers > 10000)-[:FOLLOWS]->{1,3}(audience) RETURN popular.name, count(audience)
Monitor computing engine memory to optimize your configuration. Use SHOW COMPUTE STATUS for the full row reference.
Key Rows:
topologyMemory: bytes used by the cached graph structurepropertyMemory: bytes used by cached propertiestotalMemory: sum of the two (the engine's own footprint)nodeCount / edgeCount: how much of the graph is currently cached; compare against the graph's totals to gauge coverage under a memory limitmemoryLimit: the configured cap, when setgoMemLimit / memLimitUsedPct: the process-wide soft memory limit (the GOMEMLIMIT ceiling) and how close the process is to it; > ~90% warns of an imminent garbage-collection stall (see Configuration)Tuning Tips:
MEMORY_LIMIT or cache fewer properties per label.ASYNC mode during write-heavy periods.View computing engine statistics:
GQL-- Current graph SHOW COMPUTE STATUS -- A specific graph SHOW COMPUTE STATUS ON GRAPH myGraph
Common memory-related issues and solutions:
Build Fails or Incomplete
High Memory, No Speedup
Out of Memory Errors
Slow After Writes
NOTEWarning: Always leave at least 20% of system RAM for the operating system and query execution. Setting memory limits too high can cause system instability.