MCPcopy
hub / github.com/opencontainers/runc / NotifyMemoryPressure

Method NotifyMemoryPressure

libcontainer/container_linux.go:818–824  ·  view source on GitHub ↗

NotifyMemoryPressure returns a read-only channel signaling when the container reaches a given pressure level.

(level PressureLevel)

Source from the content-addressed store, hash-verified

816// NotifyMemoryPressure returns a read-only channel signaling when the
817// container reaches a given pressure level.
818func (c *Container) NotifyMemoryPressure(level PressureLevel) (<-chan struct{}, error) {
819 // XXX(cyphar): This requires cgroups.
820 if c.config.RootlessCgroups {
821 logrus.Warn("getting memory pressure notifications may fail if you don't have the full access to cgroups")
822 }
823 return notifyMemoryPressure(c.cgroupManager.Path("memory"), level)
824}
825
826func (c *Container) updateState(process parentProcess) (*State, error) {
827 if process != nil {

Callers

nothing calls this directly

Calls 2

notifyMemoryPressureFunction · 0.85
PathMethod · 0.80

Tested by

no test coverage detected