ulimit — Set process limits

Format

ulimit [–SHaAcdfMnst] [num]

Description

ulimit sets or displays the resource limits on processes created by the user.

Options

–S
Set or display the soft limits. The soft limit may be modified to any value that is less than or equal to the hard limit. For certain resource values, the soft limit cannot be set lower than the existing usage.
–H
Set or display the hard limits. The hard limit may be lowered to any value that is greater than or equal to the soft limit. The hard limit can be raised only by a process which has superuser authority.
–a
Display all resource limits that are available.
-A
Set or display the maximum address space size for the process, in units of 1024 bytes. If the limit is exceeded, storage allocation requests and automatic stack growth will fail. An attempt to set the address space size limit lower than the current usage or to set the soft limit higher than the existing hard limit will fail.
–c
Set or display the core file limit. The core file limit is the maximum size of a dump of memory (in 512–byte blocks) allowed for the process. A value of 0 (zero) prevents file creation. Dump file creation will stop at this limit.
–d
Set or display the data size limit. The data size limit is the maximum size of the break value for the process, in units of 1024 bytes. This resource always has unlimited hard and soft limits.
–f
Set or display the file size limit. The file size limit is the maximum file size (in 512-byte blocks) allowed for the process. A value of 0 (zero) prevents file creation. If the size is exceeded, a SIGXFSZ signal is sent to the process. If the process is blocking, catching, or ignoring SIGXFSZ, continued attempts to increase the size of a file beyond the limit will fail.
–M
Set or display the amount of storage above the 2 gigabyte bar that a process is allowed to have allocated and unhidden, in megabyte increments. An attempt to set the storage size limit lower than the current usage or to set the soft limit higher than the existing hard limit will fail.

Tip: The amount of storage that ulimit -M displays does not necessarily reflect the MEMLIMIT setting found in the user's RACF® OMVS segment. The value displayed will depend on how the user entered the OMVS shell and whether a change of identity was performed.

–n
Set or display the file descriptors limit. The file descriptors limit is the maximum number of open file descriptors allowed for the process. This number is one greater than the maximum value that may be assigned to a newly created descriptor. Any function that attempts to create a new file descriptor beyond the limit will fail. An attempt to set the open file descriptors limit lower than that already used will fail.
–s
Set or display the stack size limit. The stack size limit is the maximum size of the stack for a process, in units of 1024 bytes. The stack is a per-thread resource that has unlimited hard and soft limits.
–t
Set or display the cpu time limit. The cpu time limit is the maximum amount of CPU time (in seconds) allowed for the process. If the limit is exceeded, a SIGXCPU signal is sent to the process and the process is granted a small CPU time extension to allow for signal generation and delivery. If the extension is used up, the process is terminated with a SIGKILL signal. An attempt to set the CPU limit lower than that already used will fail.
num
The new limit. num can be specified as "unlimited".

Usage notes

  1. ulimit is a built-in shell command. It cannot be used with the tcsh shell.
  2. If the command fails because of an attempt to set a resource limit lower than the current amount in use or higher than the existing hard limit, the resulting error message may indicate an invalid argument.

Localization

ulimit uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Related information

setrlimit in z/OS XL C/C++ Runtime Library Reference.