Index: lib/libc/sys/getrlimit.2 =================================================================== --- lib/libc/sys/getrlimit.2 +++ lib/libc/sys/getrlimit.2 @@ -28,7 +28,7 @@ .\" @(#)getrlimit.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 20, 2008 +.Dd August 19, 2015 .Dt GETRLIMIT 2 .Os .Sh NAME @@ -74,6 +74,8 @@ function. .It Dv RLIMIT_FSIZE The largest size (in bytes) file that may be created. +.It Dv RLIMIT_KQUEUES +The maximum number of kqueues created by this user id. .It Dv RLIMIT_MEMLOCK The maximum size (in bytes) which a process may lock into memory using the @@ -83,12 +85,15 @@ The maximum number of open files for this process. .It Dv RLIMIT_NPROC The maximum number of simultaneous processes for this user id. +.It Dv RLIMIT_NPTS +The maximum number of pseudo-terminals created by this user id. .It Dv RLIMIT_RSS -The maximum size (in bytes) to which a process's resident set size may -grow. -This imposes a limit on the amount of physical memory to be given to -a process; if memory is tight, the system will prefer to take memory +The maximum size (in bytes) a process's resident set size may +maintain in main memory if swap is available and there is memory pressure. +If memory is tight and swap is enabled, the system will prefer to take memory from processes that are exceeding their declared resident set size. +On systems that are not under memory pressure or do not have sufficient swap, +this effectively imposes no limit on a process' memory use. .It Dv RLIMIT_SBSIZE The maximum size (in bytes) of socket buffer usage for this user. This limits the amount of network memory, and hence the amount of @@ -106,10 +111,9 @@ Please see .Xr tuning 7 for a complete description of this sysctl. -.It Dv RLIMIT_NPTS -The maximum number of pseudo-terminals created by this user id. -.It Dv RLIMIT_KQUEUES -The maximum number of kqueues created by this user id. +.It Dv RLIMIT_VMEM +An alias for +.Dv RLIMIT_AS . .El .Pp A resource limit is specified as a soft limit and a hard limit. @@ -170,6 +174,22 @@ .Dv SIGXCPU is sent to the offending process. +.Pp +When a +.Xr mmap 2 +would allocate more virtual memory than allowed by the soft limit of +.Dv RLIMIT_AS +or +.Dv RLIMIT_VMEM , +no signal is raised; however, the operation fails with +.Dv ENOMEM . +The caller is free to raise the soft address space limit up to the hard limit +and retry the allocation. +.Pp +.Dv RLIMIT_RSS +does not signal or kill processes that exceed their nominal RSS limits; it is +simply a hint to the vm swap daemon to prefer to evict pages from any such +process to swap. .Sh RETURN VALUES .Rv -std .Sh ERRORS