Skip to main content

query_memory_limit_from_env

Function query_memory_limit_from_env 

Source
pub fn query_memory_limit_from_env() -> Option<usize>
Expand description

Resolve the default per-engine memory limit from the KRISHIV_QUERY_MEMORY_LIMIT_BYTES environment variable, falling back to a cgroup-derived default when the variable is unset.

Fallback: 25% of the container’s cgroup memory limit (v2 memory.max, v1 memory.limit_in_bytes). Several engines can be live in one process (executor task slots, the Flight SQL host, IVM ticks), so a single engine’s pool must not claim the whole container. Explicit 0 disables the limit entirely (DataFusion’s default unbounded pool); an unlimited cgroup (no limit / max) also yields None.