增加(或减少)R 进程可用的内存 [英] Increasing (or decreasing) the memory available to R processes

查看:22
本文介绍了增加(或减少)R 进程可用的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想增加(或减少)R 可用的内存量.实现这一目标的方法是什么?

I would like to increase (or decrease) the amount of memory available to R. What are the methods for achieving this?

推荐答案

来自:

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

Windows 用户可能会收到 R内存不足.

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

如果你已经安装了 R 并且随后安装更多的内存,你可以必须重新安装 R 才能使用额外容量的优势.

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.

您也可以设置数量手动可用内存.关闭 R,然后右键单击您的 R 程序图标(桌面上或您的程序目录).选择属性",然后选择快捷方式"选项卡.寻找``Target'' 字段和结束后在 R 的位置周围引用可执行,添加

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

--max-mem-size=500M

如下图所示.你可以将此值增加到 2GB 或您的最大物理 RAM 量已经安装.

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

如果你得到 R 不能的错误分配一个长度为 x 的向量,关闭出 R 并将以下行添加到目标"字段:

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

--max-vsize=500M

或视情况而定.你总是可以检查 R 有多少内存可以通过在 R 提示符下键入

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

which gives you the amount of available memory in MB. In previous versions of R you needed to use: round(memory.limit()/2^20, 2).

这篇关于增加(或减少)R 进程可用的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆