Home

RLIMITRSS

RLIMIT_RSS is a POSIX resource limit that specifies the maximum resident set size (RSS) a process may occupy. RSS is the portion of a process’s memory that is currently resident in physical RAM, excluding swapped-out pages and memory that is not loaded. The limit is designed to be queried and modified with the getrlimit and setrlimit system calls, using a struct rlimit where the soft limit (rlim_cur) and the hard limit (rlim_max) are expressed in bytes.

In practice, RSS-based limits are defined as part of a broader set of memory-related controls. Soft limits

Because RSS measures only the memory currently resident in RAM, it does not account for memory that

See also: getrlimit, setrlimit, RLIMIT_AS, RLIMIT_STACK, RLIMIT_DATA, VmRSS, cgroups.

can
be
raised
up
to
the
hard
limit,
or
lowered
to
restrict
memory
usage.
However,
the
effectiveness
of
RLIMIT_RSS
depends
on
the
operating
system
and
memory
management
policies.
On
many
Linux
systems,
RLIMIT_RSS
is
not
actively
enforced,
and
modern
memory
limitations
are
more
reliably
achieved
using
RLIMIT_AS
(address
space
limit)
or
memory
cgroups.
BSD
variants
historically
used
RSS
limits
more
directly,
but
enforcement
can
vary
by
implementation
and
kernel
version.
is
swapped
out
or
not
yet
allocated,
and
it
can
be
a
poor
indicator
of
a
process’s
total
memory
footprint
in
systems
with
dynamic
paging
or
complex
memory
usage
patterns.
For
robust
memory
control
on
contemporary
systems,
administrators
often
rely
on
RLIMIT_AS
or
containerization
and
cgroups
rather
than
RLIMIT_RSS
alone.