process-cpp
3.0.0
A simple convenience library for handling processes in C++11.
|
#include <oom_adj.h>
Public Member Functions | |
bool | is_valid () const |
is_valid checks whether the contained value is within the predefined bounds. More... | |
Static Public Member Functions | |
static int | disable_value () |
Returns the value that makes a process "invisible" to the oom killer. More... | |
static int | min_value () |
Returns the minimum valid value. More... | |
static int | max_value () |
Returns the maximum valid value. More... | |
Public Attributes | |
int | value |
Current value. More... | |
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.
|
static |
Returns the value that makes a process "invisible" to the oom killer.
Definition at line 40 of file oom_adj.cpp.
|
inline |
is_valid checks whether the contained value is within the predefined bounds.
Definition at line 74 of file oom_adj.h.
Referenced by core::posix::linux::proc::process::operator<<().
|
static |
Returns the maximum valid value.
Definition at line 50 of file oom_adj.cpp.
Referenced by TEST().
|
static |
Returns the minimum valid value.
Definition at line 45 of file oom_adj.cpp.
Referenced by TEST().
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>>().