MacOS上的R错误:矢量内存已耗尽(已达到极限?) [英] R on MacOS Error: vector memory exhausted (limit reached?)
问题描述
我正在尝试运行R脚本(特别是,我正在使用Bioconductor软件包
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).
我确实知道在Stackoverflow上还有其他类似的问题,但是它们都建议切换到R的64位版本.但是,我已经在使用此版本.到目前为止,这个问题似乎没有其他答案,我想知道是否有人知道?
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?
数据仅约120mb,远小于我计算机的8GB RAM.
The data is only ~120mb in size, which is far less than my computer's 8GB of RAM.
推荐答案
对于使用Rstudio的用户,我发现如在多个StackOverflow帖子中所建议的那样,设置Sys.setenv('R_MAX_VSIZE'=32000000000)
仅在命令行上有效,并且在使用Rstudio时设置该参数不会阻止此错误:
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:
第1步:打开终端,
第2步:
cd ~
touch .Renviron
open .Renviron
第3步:将以下内容保存为.Renviron
的第一行:
Step 3: Save the following as the first line of .Renviron
:
R_MAX_VSIZE=100Gb
注意:此限制包括物理内存和虚拟内存.因此,在具有16Gb物理内存的计算机上设置_MAX_VSIZE = 16Gb可能不会防止此错误.您可能必须使用此参数,具体取决于计算机的规格
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屋!