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).
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:
Key Metrics:
Tuning Tips:
View computing engine statistics:
GQL-- Check computing engine status SHOW GRAPH myGraph COMPUTE STATUS -- Expected output: -- enabled: true -- sync_mode: SYNC -- memory_limit: 4GB -- memory_used: 3.2GB -- topology_coverage: 100% -- property_coverage: 85% -- cache_hit_rate: 94%
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.