Struct Memory

Source
pub struct Memory {
    pub fail_cnt: u64,
    pub limit_in_bytes: i64,
    pub usage_in_bytes: u64,
    pub max_usage_in_bytes: u64,
    pub move_charge_at_immigrate: u64,
    pub numa_stat: NumaStat,
    pub oom_control: OomControl,
    pub soft_limit_in_bytes: i64,
    pub stat: MemoryStat,
    pub swappiness: u64,
    pub use_hierarchy: u64,
}
Expand description

State of and statistics gathered by the kernel about the memory usage of the control group’s tasks.

Fields§

§fail_cnt: u64

How many times the limit has been hit.

§limit_in_bytes: i64

The limit in bytes of the memory usage of the control group’s tasks.

§usage_in_bytes: u64

The current usage of memory by the control group’s tasks.

§max_usage_in_bytes: u64

The maximum observed usage of memory by the control group’s tasks.

§move_charge_at_immigrate: u64

Whether moving charges at immigrate is allowed.

§numa_stat: NumaStat

Contains various statistics about the NUMA locality of the control group’s tasks.

The format of this field (as lifted from the kernel sources):

total=<total pages> N0=<node 0 pages> N1=<node 1 pages> ...
file=<total file pages> N0=<node 0 pages> N1=<node 1 pages> ...
anon=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
unevictable=<total anon pages> N0=<node 0 pages> N1=<node 1 pages> ...
hierarchical_<counter>=<counter pages> N0=<node 0 pages> N1=<node 1 pages> ...
§oom_control: OomControl

Various statistics and control information about the Out Of Memory killer.

§soft_limit_in_bytes: i64

Allows setting a limit to memory usage which is enforced when the system (note, not the control group) detects memory pressure.

§stat: MemoryStat

Contains a wide array of statistics about the memory usage of the tasks in the control group.

§swappiness: u64

Set the tendency of the kernel to swap out parts of the address space consumed by the control group’s tasks.

Note that setting this to zero does not prevent swapping, use mlock(2) for that purpose.

§use_hierarchy: u64

If set, then under OOM conditions, the kernel will try to reclaim memory from the children of the offending process too. By default, this is not allowed.

Trait Implementations§

Source§

impl Debug for Memory

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Memory

§

impl RefUnwindSafe for Memory

§

impl Send for Memory

§

impl Sync for Memory

§

impl Unpin for Memory

§

impl UnwindSafe for Memory

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.