ulimit command (sets limits on system resources) (UNIX only)
- Organization of this page
Format
ulimit [-H] [-S] [-a] [-c] [-d] [-f] [-l] [-m] [-n] [-p] [-s] [-t] [limit]
Description
This command sets limits on system resources or displays information about limits on system resources that have been set. This command is used to set upper limits on system resources that are specified by option specifications, as well as to output to the standard output limits that have been set.
The following table shows the output formats for displaying resource limits.
Output format |
Contents |
---|---|
time(cpu-seconds) upper-limit |
Maximum CPU time |
file(blocks) upper-limit |
Maximum file size |
coredump(blocks) upper-limit |
Maximum file size of core dump |
data(kbytes) upper-limit |
Maximum data area size |
stack(kbytes) upper-limit |
Maximum stack area size |
lockedmem(kbytes) upper-limit |
Maximum size of physical memory that can be locked |
memory(kbytes) upper-limit |
Maximum size of physical memory that can be used |
nofiles(descriptors) upper-limit |
Maximum number of file descriptors |
processes upper-limit |
Maximum number of processes |
Arguments
If you indicate multiple resources by specifying more than one resource option, the option specified last takes effect.
- -H
-
Specifies that the limit being set (or displayed) is a hard limit. If the -H and -S options are both specified, the one specified last takes effect.
- -S
-
Specifies that the limit being set (or displayed) is a soft limit. If the -H and -S options are both specified, the one specified last takes effect.
- -a
-
Specifies that the upper limits for all resources are to be output.
- -c
-
Specifies that a maximum size for a core dump file (in blocks) is to be set or displayed.
- -d
-
Specifies that a maximum data area size (in kilobytes) is to be set or displayed.
- -f
-
Specifies that a maximum file size (in blocks) for files written by a shell or by processes launched from a shell is to be set or displayed.
- -l (Linux only)
-
Specifies that a maximum size (in kilobytes) for the physical memory that can be locked is to be set or displayed.
- -m (AIX, HP-UX, and Linux only)
-
Specifies that a maximum size (in kilobytes) for the physical memory that can be used is to be set or displayed.
- -n
-
Specifies that a maximum number of file descriptors that can be open is to be set or displayed.
- -p (Linux only)
-
Specifies that a maximum number of processes that one user can start is to be set or displayed.
- -s
-
Specifies that a maximum size (in kilobytes) of the stack area is to be set or displayed.
- -t
-
Specifies that a maximum CPU time (in seconds) is to be set or displayed.
- limit
-
Specifies the resource limit value that is to be set. If you specify unlimited, no upper limit is set for the resource. You can specify any numeric value as an upper limit, but for details about the upper limits that are valid in practice, see the documentation for the OS being used.
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
1 |
Error termination |
Notes
-
When either of the following conditions apply, the ulimit command outputs the KNAX6710-I message indicating that the command is not supported, and then terminates normally with a return code of 0:
-
A specified option is not supported by the OS.
-
You are running in a Windows environment.
-
-
Even if the command syntax of this regular built-in command is invalid, it does not exit the shell that is executing the command.
-
If the maximum file size set with the ulimit command is too small to be able to generate the files required when you run a job definition script with the adshexec command, you might receive the SIGXFSZ signal.
-
To increase the hard limit, you need the administrator's permission.
-
The upper limits on resources that can be specified depend on the execution environment and the OS.
-
For some resources whose limits are to be changed, if you specify a value that is not permitted, the execution environment or the OS might set a different value.
Usage example
-
Output the upper limits for all resources.
Contents of the job definition script
ulimit -a
Contents of the STDOUT file of the execution job
******** JOB SCOPE STDOUT ******** time(cpu-seconds) unlimited file(blocks) unlimited coredump(blocks) 0 data(kbytes) unlimited stack(kbytes) 10240 lockedmem(kbytes) 32 memory(kbytes) unlimited nofiles(descriptors) 1024 processes 4096