MCPcopy Index your code
hub / github.com/containerd/containerd / AdjustOOMScore

Function AdjustOOMScore

pkg/sys/oom_linux.go:38–45  ·  view source on GitHub ↗

AdjustOOMScore sets the oom score for the provided pid. If the provided score is out of range (-1000 - 1000), it is clipped to the min/max value.

(pid, score int)

Source from the content-addressed store, hash-verified

36// AdjustOOMScore sets the oom score for the provided pid. If the provided score
37// is out of range (-1000 - 1000), it is clipped to the min/max value.
38func AdjustOOMScore(pid, score int) error {
39 if score > OOMScoreAdjMax {
40 score = OOMScoreAdjMax
41 } else if score < OOMScoreAdjMin {
42 score = OOMScoreAdjMin
43 }
44 return SetOOMScore(pid, score)
45}
46
47// SetOOMScore sets the oom score for the provided pid
48func SetOOMScore(pid, score int) error {

Callers

nothing calls this directly

Calls 1

SetOOMScoreFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…