MacOS 上的 R 错误:向量内存已用尽(已达到限制?) [英] R on MacOS Error: vector memory exhausted (limit reached?)
问题描述
我正在尝试运行 R 脚本(特别是,我正在使用 Bioconductor 包中的getLineages"函数,
对于那些使用 Rstudio 的人,我发现设置 Sys.setenv('R_MAX_VSIZE'=32000000000)
,正如所建议的在多个 StackOverflow 帖子上,仅适用于命令行,并且在使用 Rstudio 时设置该参数并不能防止此错误:
错误:向量内存耗尽(达到限制?)
阅读更多内容后,我发现 this 线程,它澄清了 Rstudio 的问题,并确定了一个解决方案,如下所示:
第一步:打开终端,
第 2 步:
cd ~触摸.Renviron打开 .Renviron
第三步:将以下内容保存为.Renviron
的第一行:
R_MAX_VSIZE=100Gb
注意:此限制包括物理内存和虚拟内存;因此在具有 16Gb 物理内存的机器上设置 _MAX_VSIZE=16Gb 可能无法防止此错误.您可能需要使用此参数,具体取决于您机器的规格
I'm trying to run an R script (in particular, I am using the "getLineages" function from the Bioconductor package, Slingshot.
I'm wondering why the error "vector memory exhausted (limit reached?)" is showing up when I use this function, as it doesn't seem to be the most memory-intensive function compared to the other functions in this package (with the data I am analyzing).
I do understand that there are other questions like this on Stackoverflow, but they all suggest to switch over to the 64-bit version of R. However, I am already using this version. There seem to be no other answers to this issue so far, I was wondering if anyone might know?
The data is only ~120mb in size, which is far less than my computer's 8GB of RAM.
For those using Rstudio, I've found that setting Sys.setenv('R_MAX_VSIZE'=32000000000)
, as has been suggested on multiple StackOverflow posts, only works on the command line, and that setting that parameter while using Rstudio does not prevent this error:
Error: vector memory exhausted (limit reached?)
After doing some more reading, I found this thread, which clarifies the problem with Rstudio, and identifies a solution, shown below:
Step 1: Open terminal,
Step 2:
cd ~
touch .Renviron
open .Renviron
Step 3: Save the following as the first line of .Renviron
:
R_MAX_VSIZE=100Gb
Note: This limit includes both physical and virtual memory; so setting _MAX_VSIZE=16Gb on a machine with 16Gb of physical memory may not prevent this error. You may have to play with this parameter, depending on the specs of your machine
这篇关于MacOS 上的 R 错误:向量内存已用尽(已达到限制?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!