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:
Topology Budget (60% default)
Property Budget (30% default)
Working Budget (10% default)
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 Formula:
Memory = 2 * (N + 1) * 8 + 4 * E * 8 bytes
Where N = number of nodes, E = number of edges
This accounts for:
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 |
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.