resource limits

resource limits Structure: Constraints for external processes.

resource limits structure
core size integer: optional
CPU time integer: optional
data segment integer: optional
file size integer: optional
memory lock integer: optional
number of files integer: optional
number of processes integer: optional
resident set size integer: optional
stack size integer: optional

Description

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. macOS 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.

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.

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.

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.

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.

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 macOS 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 processes

Maximum number of simultaneous processes for this user id.

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

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.

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.