Trino Memory Sizing Guidelines
Best practice: Start with these guidelines, test with real workloads, and tune based on JVM and Trino metrics.
See: Trino Resource Management Docs

Trino Memory Config Calculator

Number of Worker Nodes ℹ️ The number of Trino worker nodes in your cluster. This affects cluster-wide query memory calculation.
Total Node Memory (64 GB) ℹ️ The total physical RAM available on a single Trino worker node (in GB).
Tip: Always leave some memory for the OS and other processes.
JVM Max Heap (-Xmx, 48 GB) ℹ️ Heap for the Java Virtual Machine running Trino.
Recommended: 70–80% of total node memory.
Don't set too high or you'll risk swapping and performance drops!
JVM Headroom (14 GB) ℹ️ Reserved heap for JVM overhead (thread stacks, allocations, garbage collection).
Recommended: 30% of JVM heap, minimum 2GB.
Too low risks OutOfMemoryError!
Query Max Memory per node (14 GB) ℹ️ Maximum memory (per node) that can be used for a single query.
Recommended: 30% of JVM heap.
Constraint: (Query Max Memory per node + JVM Headroom) < JVM Max Heap.
Query Max Memory (cluster-wide) (56 GB) ℹ️ Maximum memory for a single query, summed across all worker nodes.
Formula: Query Max Memory per node × Worker Nodes.
Query Max Total Memory (112 GB) ℹ️ Hard upper bound on memory for a query (usually double Query Max Memory cluster-wide).
Constraint: Must be ≥ Query Max Memory (cluster-wide).

Generated Trino Config

Notes & Validation Tips:
This calculator provides a guideline and safe starting point. Final tuning should always be data-driven.