effective-limits

Crates.ioeffective-limits
lib.rseffective-limits
version0.5.5
sourcesrc
created_at2020-02-22 00:37:26.595855
updated_at2022-11-20 21:45:16.476127
descriptionEstimate effective resource limits for a process e.g. how much RAM is available for use.
homepage
repositoryhttps://github.com/rbtcollins/effective-limits.rs
max_upload_size
id211338
size115,522
Daniel Silverstone (kinnison)

documentation

README

Estimate effective resource limits for a process

effective-limits is a mid-level API for determining the effective limits upon a process. It combines e.g. mem_info and getrlimit.

The goal is to have a good chance of avoiding failed allocations without requiring either developer or user a-priori selection of memory limits. That is, 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. This limit can then be used to inform the size of in memory caches, put a threshold on in or output file buffers and so on.

#![warn(clippy::all)]

extern crate effective_limits;

fn main() -> effective_limits::Result<()> {
    println!("Effective mem limit: {}", effective_limits::memory_limit()?);
    Ok(())
}
Commit count: 58

cargo fmt