memory_limit

Function memory_limit 

Source
pub fn memory_limit() -> Result<u64>
Expand description

How much memory is effectively available for this process to use, considering the physical machine and ulimits, but not the impact of noisy neighbours, swappiness and so on. The goal is to have a good chance of avoiding failed allocations without requiring either developer or user a-priori selection of memory limits.

Examples found in repository?
examples/memory.rs (line 6)
5fn main() -> effective_limits::Result<()> {
6    println!("Effective mem limit: {}", effective_limits::memory_limit()?);
7    Ok(())
8}