limit
or
ulimit
for how to impose limitations on the resources available
to a single process. For example a bash
user could use
ulimit -t 600 -v 4000000whereas a
csh
user might use
limit cputime 10m limit vmemoryuse 4096mto limit a process to 10 minutes of CPU time and (around) 4Gb of virtual memory. (There are other options to set the RAM in use, but they are not generally honoured.)
memory.size
and memory.limit
.R holds all objects in virtual memory, and there are limits based on the amount of memory that can be used by all objects:
Memory
-- but these are
usually not imposed.
Error messages beginning cannot allocate vector of size
indicate a failure to obtain memory, either because the size exceeded
the address-space limit for a process or, more likely, because the
system was unable to provide the memory. Note that on a 32-bit build
there may well be enough free memory available, but not a large enough
contiguous block of address space into which to map it.
There are also limits on individual objects. The storage space
cannot exceed the address limit, and if you try to exceed that limit,
the error message begins cannot allocate vector of length
.
The number of bytes in a character string is limited to
$2^31 - 1 ~ 2*10^9$,
which is also the limit on each dimension of an array.
object.size(a)
for the (approximate) size of R object
a
.