core::posix::linux::proc::process::OomAdj Struct Reference

`#include <oom_adj.h>`

Collaboration diagram for core::posix::linux::proc::process::OomAdj:

## Public Member Functions

bool | is_valid () const
| is_valid checks whether the contained value is within the predefined bounds.

## Static Public Member Functions

static int | disable_value ()
| Returns the value that makes a process "invisible" to the oom killer.
static int | min_value ()
| Returns the minimum valid value.
static int | max_value ()
| Returns the maximum valid value.

## Public Attributes

int | value
| Current value.

## Detailed Description

This file can be used to adjust the score used to select which process should be killed in an out-of-memory (OOM) situation. The kernel uses this value for a bit-shift operation of the process's oom_score value: valid values are in the range -16 to +15, plus the special value -17, which disables OOM-killing altogether for this process. A positive score increases the likelihood of this process being killed by the OOM-killer; a negative score decreases the likelihood.

The default value for this file is 0; a new process inherits its parent's oom_adj setting. A process must be privileged (CAP_SYS_RESOURCE) to update this file.

Since Linux 2.6.36, use of this file is deprecated in favor of /proc/[pid]/oom_score_adj.

Definition at line 50 of file oom_adj.h.

## Member Function Documentation

## disable_value()

int core::posix::linux::proc::process::OomAdj::disable_value | ( |  | ) |

static

Returns the value that makes a process "invisible" to the oom killer.

Returns
  Returns the value that makes a process "invisible" to the oom killer.

Definition at line 40 of file oom_adj.cpp.

## is_valid()

bool core::posix::linux::proc::process::OomAdj::is_valid | ( |  | ) | const

inline

is_valid checks whether the contained value is within the predefined bounds.

Returns
  true iff min_value() <= value <= max_value().

Definition at line 74 of file oom_adj.h.

Referenced by core::posix::linux::proc::process::operator<<().

## max_value()

int core::posix::linux::proc::process::OomAdj::max_value | ( |  | ) |

static

Returns the maximum valid value.

Returns
  The maximum valid value that the OomAdj can be set to.

Definition at line 50 of file oom_adj.cpp.

Referenced by TEST().

## min_value()

int core::posix::linux::proc::process::OomAdj::min_value | ( |  | ) |

static

Returns the minimum valid value.

Returns
  The minimum valid value that the OomAdj can be set to.

Definition at line 45 of file oom_adj.cpp.

Referenced by TEST(), and TEST().

## Member Data Documentation

## value

int core::posix::linux::proc::process::OomAdj::value

Current value.

Definition at line 82 of file oom_adj.h.

Referenced by core::posix::linux::proc::process::operator<<(), and core::posix::linux::proc::process::operator>>().

The documentation for this struct was generated from the following files:

- oom_adj.h
- oom_adj.cpp