2 .\" Copyright 2011 Davidlohr Bueso <dave@gnu.org>
3 .\" May be distributed under the GNU General Public License
5 .TH PRLIMIT 1 "July 2014" "util-linux" "User Commands"
7 prlimit \- get and set process resource limits
9 .BR prlimit " [options]"
10 .RB [ \-\-\fIresource\fR [ =\fIlimits\fR]
11 .RB [ \-\-pid\ \fIPID\fR]
13 .BR prlimit " [options]"
14 .RB [ \-\-\fIresource\fR [ =\fIlimits\fR]
15 .IR "command " [ argument ...]
18 Given a process ID and one or more resources, \fBprlimit\fP tries to retrieve
19 and/or modify the limits.
21 When \fIcommand\fR is given,
23 will run this command with the given arguments.
25 The \fIlimits\fP parameter is composed of a soft and a hard value, separated
26 by a colon (:), in order to modify the existing values. If no \fIlimits\fR are
27 given, \fBprlimit\fP will display the current values. If one of the values
28 is not given, then the existing one will be used. To specify the unlimited or
29 infinity limit (RLIM_INFINITY), the -1 or 'unlimited' string can be passed.
31 Because of the nature of limits, the soft limit must be lower or equal to the
32 high limit (also called the ceiling). To see all available resource limits,
33 refer to the RESOURCE OPTIONS section.
35 .IP "\fIsoft\fP:\fIhard\fP Specify both limits."
36 .IP "\fIsoft\fP: Specify only the soft limit."
37 .IP ":\fIhard\fP Specify only the hard limit."
38 .IP "\fIvalue\fP Specify both limits to the same value."
41 .IP "\fB\-h, \-\-help\fP"
42 Display help text and exit.
43 .IP "\fB\-\-noheadings\fP"
44 Do not print a header line.
45 .IP "\fB\-o, \-\-output \fIlist\fP"
46 Define the output columns to use. If no output arrangement is specified,
47 then a default set is used.
48 Use \fB\-\-help\fP to get a list of all supported columns.
49 .IP "\fB\-p, \-\-pid\fP"
50 Specify the process id; if none is given, the running process will be used.
52 Use the raw output format.
53 .IP "\fB\-\-verbose\fP"
55 .IP "\fB\-V, \-\-version\fP"
56 Display version information and exit.
59 .IP "\fB\-c, \-\-core\fP[=\fIlimits\fR]"
60 Maximum size of a core file.
61 .IP "\fB\-d, \-\-data\fP[=\fIlimits\fR]"
63 .IP "\fB\-e, \-\-nice\fP[=\fIlimits\fR]"
64 Maximum nice priority allowed to raise.
65 .IP "\fB\-f, \-\-fsize\fP[=\fIlimits\fR]"
67 .IP "\fB\-i, \-\-sigpending\fP[=\fIlimits\fR]"
68 Maximum number of pending signals.
69 .IP "\fB\-l, \-\-memlock\fP[=\fIlimits\fR]"
70 Maximum locked-in-memory address space.
71 .IP "\fB\-m, \-\-rss\fP[=\fIlimits\fR]"
72 Maximum Resident Set Size (RSS).
73 .IP "\fB\-n, \-\-nofile\fP[=\fIlimits\fR]"
74 Maximum number of open files.
75 .IP "\fB\-q, \-\-msgqueue\fP[=\fIlimits\fR]"
76 Maximum number of bytes in POSIX message queues.
77 .IP "\fB\-r, \-\-rtprio\fP[=\fIlimits\fR]"
78 Maximum real-time priority.
79 .IP "\fB\-s, \-\-stack\fP[=\fIlimits\fR]"
80 Maximum size of the stack.
81 .IP "\fB\-t, \-\-cpu\fP[=\fIlimits\fR]"
83 .IP "\fB\-u, \-\-nproc\fP[=\fIlimits\fR]"
84 Maximum number of processes.
85 .IP "\fB\-v, \-\-as\fP[=\fIlimits\fR]"
87 .IP "\fB\-x, \-\-locks\fP[=\fIlimits\fR]"
88 Maximum number of file locks held.
89 .IP "\fB\-y, \-\-rttime\fP[=\fIlimits\fR]"
90 Timeout for real-time tasks.
93 .IP "\fBprlimit \-\-pid 13134\fP"
94 Display limit values for all current resources.
95 .IP "\fBprlimit \-\-pid 13134 \--rss --nofile=1024:4095\fP"
96 Display the limits of the RSS, and set the soft and hard limits for the number
97 of open files to 1024 and 4095, respectively.
98 .IP "\fBprlimit \-\-pid 13134 --nproc=512:\fP"
99 Modify only the soft limit for the number of processes.
100 .IP "\fBprlimit \-\-pid $$ --nproc=unlimited\fP"
101 Set for the current process both the soft and ceiling values for the number of
102 processes to unlimited.
103 .IP "\fBprlimit --cpu=10 sort -u hugefile\fP"
104 Set both the soft and hard CPU time limit to ten seconds and run 'sort'.
111 The prlimit system call is supported since Linux 2.6.36, older kernels will
116 Davidlohr Bueso <dave@gnu.org> - In memory of Dennis M. Ritchie.
119 The prlimit command is part of the util-linux package and is available from
120 https://www.kernel.org/pub/linux/utils/util-linux/.