RLIMIT_RSS
Resident set size limit. The kernel does not enforce it on modern Linux.
- Resource number
- 5
- Row in /proc/PID/limits
- Max resident set
- bash ulimit flag
- ulimit -m
- Unit in /proc/PID/limits
- bytes
- Group
- Obsolete on Linux
What happens at the limit
Nothing. It only had an effect in Linux 2.4 before 2.4.30, and there only for madvise(2) with MADV_WILLNEED.
Setting `ulimit -m` and expecting an OOM kill is a classic. To cap resident memory, use a cgroup memory limit (memory.max under cgroup v2).
Check a running process with grep -i "Max resident set" /proc/PID/limits, or paste the whole file into the limits reader. Inspect or change one on a live process with prlimit --pid PID(util-linux).
Sources
Resource numbers are from asm-generic/resource.h; a few architectures (Alpha, MIPS, SPARC) number some limits differently. The list of syscall cards is matched by name from the card text on this site, not from the kernel source. Spot one that's wrong? Tell Rod.