Name

resource limits, resourcelimits, kPMResourceLimits — Constraints for external processes.

Synopsis

resource limits structure { core size, CPU time, data segment, file size, memory lock, number of files, number of processes, resident set size, stack size };
core size : integer, optional, range 0..n
CPU time : integer, optional, range 1..n
data segment : integer, optional
file size : integer, optional, range 0..n
memory lock : integer, optional, range 0..n
number of files : integer, optional, range 3..n
number of processes : integer, optional, range 0..n
resident set size : integer, optional, range 0..n
stack size : integer, optional, range 0..n

Description

Constraints for external processes.

The engine can constrain the resources used by external processes. These resources are described in detail in the link below:

http://www.opengroup.org/onlinepubs/009695399/functions/setrlimit.html

Avoid setting constraints for external executables. Mac OS X will provide adequate defaults.

Fields

core size. Largest size core file that may be created.

In BSD's setrlimit call this field maps to RLIMIT_CORE. core size is measured in bytes.

core size is an integer. core size is optional. core size must be more than or equal to 0.

CPU time. Maximum amount of CPU time to be used.

In BSD's setrlimit call this field maps to RLIMIT_CPU. CPU time is measured in seconds.

CPU time is an integer. CPU time is optional. CPU time must be more than or equal to 1.

data segment. Maximum size of the data segment.

In BSD's setrlimit call this field maps to RLIMIT_DATA. data segment is measured in bytes.

data segment is an integer. data segment is optional.

file size. Largest size file that may be created.

In BSD's setrlimit call this field maps to RLIMIT_FSIZE. file size is measured in bytes.

file size is an integer. file size is optional. file size must be more than or equal to 0.

memory lock. Maximum size of memory that may be locked using mlock.

The mlock function is used to lock physical pages of memory. This means those pages can not be swapped to disk by virtual memory.

In BSD's setrlimit call this field maps to RLIMIT_MEMLOCK. memory lock is measured in bytes.

memory lock is an integer. memory lock is optional. memory lock must be more than or equal to 0.

number of files. Maximum number of open files.

Be careful limiting the number of open files an external process can open. Processes often need more files than even the developer expects. Open files include the three standard files:

standard in;
standard out;
standard error.

Open files are also needed to make use of Mac OS X frameworks and other linked-at-runtime resources. Use the command line tool lsof to examine what processes have what files open.

In BSD's setrlimit call this field maps to RLIMIT_NOFILE.

number of files is an integer. number of files is optional. number of files must be more than or equal to 3.

number of processes. Maximum number of simultaneous processes for this user id.

In BSD's setrlimit call this field maps to RLIMIT_NPROC.

number of processes is an integer. number of processes is optional. number of processes must be more than or equal to 0.

resident set size. Maximum amount of physical memory.

The maximum size to which a process's resident set size may grow. This limits the physical memory provided to the external process but it does not restrict the virtual memory.

In BSD's setrlimit call this field maps to RLIMIT_AS / RLIMIT_RSS. resident set size is measured in bytes.

resident set size is an integer. resident set size is optional. resident set size must be more than or equal to 0.

stack size. Maximum size of the stack segment.

In BSD's setrlimit call this field maps to RLIMIT_STACK. stack size is measured in bytes.

stack size is an integer. stack size is optional. stack size must be more than or equal to 0.