Unable to install modules, Unable to allocate memory error?

I just launched the new EC2 ubuntu t1.micro . I installed R 3.1.2 , and when I try to install any module, I get:

 Warning messages: 1: In system2(cmd0, args, env = env, stdout = outfile, stderr = outfile) : system call failed: Cannot allocate memory 2: In install.packages("zoo") : installation of package 'zoo' had non-zero exit status 

I read another question that this might be due to swap memory, but in my case the memory is set to 60, which I think should be fine.

When I run .libsPaths() , I get

 > .libPaths() [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" [3] "/usr/lib/R/library" 

At first, R complained that he did not have permission to write to /usr/lib/R/library , but after I changed the permissions of the directory, the error disappeared.

Any clue on how to make it work would be greatly appreciated. Thanks

+6
source share
2 answers

So, I tested the same with a large instance (t1.small), and it worked fine. It seems that R does not work with instances of EC2 t1.micro .

The main difference between the two types of instances is that although t1.micro has 0.6 GB of memory, t1.small has 1.7 GB.

Failed to check it on instances of type t2, they may work better.

+4
source

Workaround detected. You can use the Rscript form command line:

 Rscript -e "install.packages('urca', repos='http://cran.us.r-project.org')" 

Works with AWS, Amazon Linux, t2.micro instance.

+2
source

Source: https://habr.com/ru/post/981633/


All Articles