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

查看:93
本文介绍了增加(或减少)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用户可能会收到以下错误: 内存不足.

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

如果您已经安装了R,并且 随后安装更多RAM,您可以 必须重新安装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程序 图标(桌面上或桌面上的图标 您的程序目录).选择 ``属性'',然后选择 ``快捷方式''选项卡.寻找 ``目标''字段和结束后 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天全站免登陆