Skip to main content

get_available_memory

Function get_available_memory 

Source
pub fn get_available_memory() -> u64
Expand description

Get available system memory in bytes.

Performs a real runtime probe of the host’s currently-available physical memory via scirs2_core’s resource-discovery layer (reading /proc/meminfo’s MemAvailable on Linux, and the platform-native equivalent elsewhere). If the probe genuinely cannot determine the host’s memory (e.g. an unsupported platform or a sandboxed environment without /proc), this falls back to a conservative 8 GB estimate rather than propagating an error into every caller of this bool-returning utility – callers that need the honest failure mode should call scirs2_core::resource::get_available_memory() directly.