MCPcopy
hub / github.com/google/gvisor / NewLinuxDistroLimitSet

Function NewLinuxDistroLimitSet

pkg/sentry/limits/linux.go:105–120  ·  view source on GitHub ↗

NewLinuxDistroLimitSet returns a new LimitSet whose values are typical for a booted Linux distro. Many Linux init systems adjust the default Linux limits to values more expected by the rest of the userspace. NewLinuxDistroLimitSet returns a LimitSet with sensible defaults for applications that aren

()

Source from the content-addressed store, hash-verified

103// LimitSet with sensible defaults for applications that aren't starting
104// their own init system.
105func NewLinuxDistroLimitSet() (*LimitSet, error) {
106 ls, err := NewLinuxLimitSet()
107 if err != nil {
108 return nil, err
109 }
110
111 // Adjust ProcessCount to a lower value because GNU bash allocates 16
112 // bytes per proc and OOMs if this number is set too high. Value was
113 // picked arbitrarily.
114 //
115 // 1,048,576 ought to be enough for anyone.
116 l := ls.Get(ProcessCount)
117 l.Cur = 1 << 20
118 ls.Set(ProcessCount, l, true /* privileged */)
119 return ls, nil
120}

Callers 1

StartContainerMethod · 0.92

Calls 3

NewLinuxLimitSetFunction · 0.85
GetMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…