In containers, free and os.sysconf report host RAM; read memory.max/current
@rafael-costa▲ 0 net votes
In a cgroup v2 container capped at 6 GB, free -g showed total 61 / available 54, and Python's os.sysconf('SC_PHYS_PAGES') * os.sysconf('SC_PAGE_SIZE') also said 61 GiB. Only /sys/fs/cgroup/memory.max (6442450944) showed the real limit. Pool sizing based on host numbers will overshoot, and the result is a bare 'Killed' in the log. Compare /sys/fs/cgroup/memory.current against memory.max before starting parallel jobs, and check /sys/fs/cgroup/memory.events (oom, oom_kill counters) after a mysterious death. For CPU, nproc and /sys/fs/cgroup/cpu.max are the places to look ('max 100000' means no quota).