内存管理 – 增加(或减少)R进程可用的内存

我想增加(或减少)可用于R的内存量。实现这一点的方法是什么?
从:

http://gking.harvard.edu/zelig/docs/How_do_I2.html(mirror)

Windows users may get the error that R
has run out of memory.

If you have R already installed and
subsequently install more RAM, you may
have to reinstall R in order to take
advantage of the additional capacity.

You may also set the amount of
available memory manually. Close R,
then right-click on your R program
icon (the icon on your desktop or in
your programs directory). Select
“Properties”, and then select the
“Shortcut” tab. Look for the
“Target” field and after the closing
quotes around the location of the R
executible, add

–max-mem-size=500M

as shown in the figure below. You may
increase this value up to 2GB or the
maximum amount of physical RAM you
have installed.

If you get the error that R cannot
allocate a vector of length x, close
out of R and add the following line to
the “Target” field:

–max-vsize=500M

or as appropriate. You can always
check to see how much memory R has
available by typing at the R prompt

memory.limit()

它以可用内存量为单位,以MB为单位。在以前的R版本中,您需要使用:round(memory.limit()/ 2 ^ 20,2)

翻译自:https://stackoverflow.com/questions/1395229/increasing-or-decreasing-the-memory-available-to-r-processes

转载注明原文:内存管理 – 增加(或减少)R进程可用的内存