首页 > 解决方案 > rstudio 的 Ubuntu 内存问题

问题描述

您好,我遇到了一个问题,即在加载一些对象后,我无法执行任何类型的系统调用。我注意到这一点,因为即使是我的 pdf 渲染也不起作用。

例如

 > sessionInfo()
Error in system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE) : 
cannot popen '/usr/bin/which 'uname' 2>/dev/null', probable reason 'Cannot allocate memory'

当我尝试 knitr 时,它给了我一个类似的错误。但是我仍然有足够的内存,例如我可以加载一个巨大的 1GB 数据帧,它会运行良好。

我的 rstudio 会话如下:

R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
 [1] compiler_3.5.0  htmltools_0.3.6 tools_3.5.0     yaml_2.2.0      Rcpp_1.0.1      rmarkdown_1.12  knitr_1.22      xfun_0.6        digest_0.6.18   evaluate_0.13 

有什么建议么?


> Sys.which("uname")
Error in system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE) :
    cannot popen '/usr/bin/which 'uname' 2>/dev/null', probable reason 'Cannot allocate memory'  
> traceback()  
4: system(paste(which, shQuote(names[i])), intern = TRUE, ignore.stderr = TRUE) 
3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning")) 
2: suppressWarnings(system(paste(which, shQuote(names[i])), intern = TRUE,         ignore.stderr = TRUE)) 
1: Sys.which("uname")

标签: r

解决方案


推荐阅读