File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -395,10 +395,8 @@ impl Container<'_> {
395395 /// Tries cgroups v2 first, then falls back to cgroups v1.
396396 fn read_memory_peak ( & self ) -> Option < u64 > {
397397 let paths = [
398- // cgroups v2
399- "/sys/fs/cgroup/memory.peak" ,
400- // cgroups v1
401- "/sys/fs/cgroup/memory/memory.max_usage_in_bytes" ,
398+ "/sys/fs/cgroup/memory.peak" , // v2
399+ "/sys/fs/cgroup/memory/memory.max_usage_in_bytes" , // v1
402400 ] ;
403401 for path in paths {
404402 if let Some ( val) = self
@@ -420,10 +418,8 @@ impl Container<'_> {
420418 fn check_cgroup_oom ( & self ) -> bool {
421419 // Both v1 and v2 expose `oom_kill <count>` — just in different files.
422420 let paths = [
423- // cgroups v2
424- "/sys/fs/cgroup/memory.events" ,
425- // cgroups v1
426- "/sys/fs/cgroup/memory/memory.oom_control" ,
421+ "/sys/fs/cgroup/memory.events" , // v2
422+ "/sys/fs/cgroup/memory/memory.oom_control" , // v1
427423 ] ;
428424 for path in paths {
429425 if let Some ( lines) = self . exec_cat_file ( path) {
You can’t perform that action at this time.
0 commit comments