vibeqc.available_memory_bytes

vibeqc.available_memory_bytes()[source]

Best-effort available-RAM probe for the current process.

The host-wide probe prefers psutil when installed and falls back to platform-specific mechanisms. On Linux, a finite cgroup v2 or v1 memory allowance bounds that host value so scheduler and container allocations are respected.

An explicit VIBEQC_MEMORY_LIMIT_BYTES or VQ_MEM_MB environment variable takes priority over every probe, so orchestrators (vq submit, Docker, SLURM, …) can directly declare the job’s memory budget regardless of platform or containerisation.

Returns 0 only when no probe succeeds, in which case the caller should treat the result as “unknown” rather than “no memory”.