#mem #limits #resource #effective

bin+lib effective-limits

Estimate effective resource limits for a process e.g. how much RAM is available for use.

6 releases (breaking)

0.5.1 Jun 26, 2020
0.5.0 May 25, 2020
0.4.0 Apr 24, 2020
0.3.0 Feb 24, 2020
0.1.0 Feb 22, 2020

#71 in Configuration

Download history 160/week @ 2020-05-13 202/week @ 2020-05-20 198/week @ 2020-05-27 279/week @ 2020-06-03 169/week @ 2020-06-10 78/week @ 2020-06-17 257/week @ 2020-06-24 279/week @ 2020-07-01 295/week @ 2020-07-08 231/week @ 2020-07-15 123/week @ 2020-07-22 82/week @ 2020-07-29 109/week @ 2020-08-05 119/week @ 2020-08-12 129/week @ 2020-08-19 135/week @ 2020-08-26

659 downloads per month

Apache-2.0

21KB
432 lines

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(())
}

Dependencies

~0.5–1.1MB
~27K SLoC