考虑:
> setwd('~/tmp/')
> list.files()
[1] "bar" "foo" "foobar"
> system("ls")
Warning messages:
1: In system("ls") : system call failed: Cannot allocate memory
2: In system("ls") : error in running command
当我有接近9GB的RAM显示未使用时发生。我想知道为什么system()
函数会占用大量内存。如果万一您想要我的sessionInfo()
,请对不起:
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'
所以这正是我发布此问题的原因。这种内存密集型操作严重限制了R连接到任何其他程序的能力。在我的情况下,我尝试使用htmlwidgets::saveWidget()
,它使用pandoc
检查system('which pandoc')
的存在并最终失败。
sessionInfo在香草模式下使用@hrbmstr的建议:
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] 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.1