Skip to main content

Module process_memory

Module process_memory 

Source
Expand description

Records this process’s memory use, so operators can see a node approaching its memory limit before the kernel stops it.

Structs§

CgroupMount 🔒
A mounted cgroup hierarchy.

Constants§

SAMPLE_INTERVAL 🔒
How often record_process_memory samples memory use.

Functions§

available_memory 🔒
Returns the memory this process can use: the smaller of the machine’s memory and the cgroup limit, ignoring values that are unknown or zero.
cgroup_limit 🔒
Returns a cgroup memory limit in bytes, or None if the cgroup has no limit.
cgroup_mounts 🔒
Returns the cgroup v2 mounts and the cgroup v1 memory mounts listed in /proc/self/mountinfo that no other mount hides.
kib_field 🔒
Returns the value in bytes of a name <value> kB line, as in /proc/self/status and /proc/meminfo.
limit_files 🔒
Returns the paths of file_name in the cgroup at membership and in each of its ancestors, through every mount that shows them.
read 🔒
record 🔒
Sets the process.memory.rss_bytes gauge to the resident set size of this process, and process.memory.rss_fraction to that size as a fraction of the memory it can use: the cgroup memory limit, or the machine’s memory if no cgroup sets a lower limit.
record_process_memory
Records this process’s memory use every SAMPLE_INTERVAL, until the task is aborted.
tightest_cgroup_limit 🔒
Returns the tightest memory limit on this process’s cgroups, given the contents of /proc/self/cgroup and /proc/self/mountinfo.
unescape_mountinfo 🔒
Decodes the octal escapes (such as \040 for a space) that /proc/self/mountinfo uses in paths.