Query and set memory limits

Usage

memory_limit(size = NA)

Arguments

size
numeric. If NA report the memory size, otherwise request a new limit, in MiB.

Value

A named vector with the (new) soft and hard limits in MiB.

Description

This function is used to manage the total memory allocation for the current session and for child processes. On POSIX systems, the getrlimit64(2) and setrlimit64(2) APIs with resource RLIMIT_AS are used. Support for Windows might become available in the future; in the meantime, use utils::memory.limit.

See also

Memory-limits for other limits.