MCPcopy Create free account
hub / github.com/containerd/cgroups / NewMemory

Function NewMemory

cgroup1/memory.go:157–166  ·  view source on GitHub ↗

NewMemory returns a Memory controller given the root folder of cgroups. It may optionally accept other configuration options, such as IgnoreModules(...)

(root string, options ...func(*memoryController))

Source from the content-addressed store, hash-verified

155// NewMemory returns a Memory controller given the root folder of cgroups.
156// It may optionally accept other configuration options, such as IgnoreModules(...)
157func NewMemory(root string, options ...func(*memoryController)) *memoryController {
158 mc := &memoryController{
159 root: filepath.Join(root, string(Memory)),
160 ignored: map[string]struct{}{},
161 }
162 for _, opt := range options {
163 opt(mc)
164 }
165 return mc
166}
167
168// IgnoreModules configure the memory controller to not read memory metrics for some
169// module names (e.g. passing "memsw" would avoid all the memory.memsw.* entries)

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…