由于地址限制而无法安装包,但有足够的可用内存(非零退出状态)

Can't install package due to address limit while there is enough memory available (non-zero exit status)

我正在尝试在 RStudio 中安装来自 github 的 urbnmapr 包,但我收到一个错误,提示我的 PC 地址限制太小,而有大量可用内存。我已经尝试了 in this thread.

提供的解决方案

我正在使用 devtools::install_github("UrbanInstitute/urbnmapr") 并获得以下控制台打印:

Downloading GitHub repo UrbanInstitute/urbnmapr@master
√  checking for file 'C:\Users\***********\AppData\Local\Temp\RtmpSOQbWK\remotes13fc75a94529\UrbanInstitute-urbnmapr-21be5c2/DESCRIPTION' ... 
-  preparing 'urbnmapr': (369ms)
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  looking to see if a 'data/datalist' file should be added
-  building 'urbnmapr_0.0.0.9002.tar.gz' (3.8s)

* installing *source* package 'urbnmapr' ...
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'urbnmapr'
    finding HTML links ... done
    ccdf_labels                             html  
    counties                                html  
    counties_labels                         html  
    countydata                              html  
    get_urbn_labels                         html  
    get_urbn_map                            html  
    statedata                               html  
    states                                  html  
    states_labels                           html  
    territories_counties                    html  
    territories_labels                      html  
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
Error in utils::memory.limit(104000) : 
  don't be silly!: your machine has a 4Gb address limit
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'E:/Programme/R-3.5.3/library/urbnmapr'
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/***********/AppData/Local/Temp/RtmpSOQbWK/file13fc71237900/urbnmapr_0.0.0.9002.tar.gz’ had non-zero exit status

从这个错误可以看出:Error in utils::memory.limit(104000) : don't be silly!: your machine has a 4Gb address limit Execution halted我的内存肯定够大了,但还是安装不了。我的sessionInfo()如下:

Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.2        rstudioapi_0.10   magrittr_1.5      usethis_1.5.0    
 [5] devtools_2.0.2    pkgload_1.0.2     R6_2.4.0          rlang_0.4.0      
 [9] tools_3.5.3       pkgbuild_1.0.3    sessioninfo_1.1.1 cli_1.1.0        
[13] withr_2.1.2       remotes_2.0.4     yaml_2.2.0        assertthat_0.2.1 
[17] digest_0.6.20     rprojroot_1.3-2   crayon_1.3.4      processx_3.3.1   
[21] callr_3.2.0       fs_1.3.1          ps_1.3.0          curl_3.3         
[25] memoise_1.1.0     glue_1.3.1        compiler_3.5.3    desc_1.2.0       
[29] backports_1.1.4   prettyunits_1.0.2 

有关其他信息,我正在使用单个页面文件来增加我的内存限制,但如果没有它,我有足够的内存分配超过 4Gb 和 afaik 64 位 Windows 10 应该非常能够有比这更高的地址限制。我使用支持高达 64GB dRAM 的 Intel i7-6700K 安装了 32GB dRAM。 很高兴为您提供帮助!

已解决,发帖以防其他人遇到同样的问题。

为了将页面文件用作大数据的内存,我在我的 .Rprofile 中使用了 invisible(utils::memory.limit(104000)),删除它并在不加载我的环境(即不同的,较小的项目或新文件)的情况下启动 RStudio 并且只是在该会话中安装软件包不会引发错误并且安装有效。重新启动 memory.limit 并在之后重新启动 R,一切正常。