MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / detect_limits

Function detect_limits

src/service/src/boot.rs:228–235  ·  view source on GitHub ↗

Returns the cgroup (v1 or v2) limits, if tjey exists.

()

Source from the content-addressed store, hash-verified

226
227 /// Returns the cgroup (v1 or v2) limits, if tjey exists.
228 pub fn detect_limits() -> Option<Limits> {
229 let (v2_mounts, v1_mounts) = parse_proc_self_mountinfo()?;
230 let cgroups = parse_proc_self_cgroup()?;
231 if !v2_mounts.is_empty() {
232 return read_v2_memory_limit(&cgroups, &v2_mounts);
233 }
234 read_v1_memory_limit(&cgroups, &v1_mounts)
235 }
236
237 #[cfg(test)]
238 mod tests {

Callers

nothing calls this directly

Calls 5

parse_proc_self_cgroupFunction · 0.70
read_v2_memory_limitFunction · 0.70
read_v1_memory_limitFunction · 0.70
is_emptyMethod · 0.45

Tested by

no test coverage detected