ID EN
System & OS

Memory

R Base 3.6.2

How R manages its workspace.

Details

R has a variable-sized workspace. There are (rarely-used) command-line options to control its minimum size, but no longer any to control the maximum size. On Windows the --max-mem-size option (or environment variable R_MAX_MEM_SIZE) sets the maximum (virtual) memory allocation: it has a minimum allowed value of 32M. This is intended to catch attempts to allocate excessive amounts of memory which may cause other processes to run out of resources. See also memory.limit. R maintains separate areas for fixed and variable sized objects. The first of these is allocated as an array of cons cells (Lisp programmers will know what they are, others may think of them as the building blocks of the language itself, parse trees, etc.), and the second are thrown on a heap of ‘Vcells’ of 8 bytes each. Each

See Also

An Introduction to R for more command-line options. Memory-limits for the design limitations. gc for information on the garbage collector and total memory usage object.size(a) for the (approximate) size of R object a. memory.profile for profiling the usage of cons cells. memory.size to monitor total memory usage memory.limit for the current limit.