You are not logged in.

#1 2018-04-24 23:22:48

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

[SOLVED] Memory allocation problem while installing R package ddalpha

Hi,

I have 16 Gb of RAM and never get even close to using it all. After an update of R yesterday, I had to reinstall a lot of packages and I am running into an issue with the package ddalpha:

Error in system2(file.path(R.home("bin"), "R"), c(if (nzchar(arch)) paste0("--arch=",  : 
  cannot popen ' '/usr/lib64/R/bin/R' --no-save --slave 2>&1 < '/tmp/RtmpU4dXOt/file3fb5b89c507'', probable reason 'Cannot allocate memory'

I don't know if it is an R issue (about memory allocation within R) or an Arch Linux one. I also posted the question in an R forum (https://community.rstudio.com/t/memory- … 3-5-0/7663).

Thank you!

Last edited by prosoitos (2018-05-01 02:36:41)

Offline

#2 2018-04-25 00:10:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

What command(s) are you using, `update.packages()` or `install.packages('ddalpha')` from within R, or `R CMD INSTALL ddalpha` from a shell?  Opt for latter ones in that list if you haven't tried them yet.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2018-04-25 00:43:59

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

Hi Trilby,

Thank you for your reply.

I was using `install.packages("ddalpha")` from within an R session with administrative privilege (`sudo R`).

Offline

#4 2018-04-25 05:08:35

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

Just tried

sudo R CMD INSTALL path-to-ddalpha_1.3.2.tar.gz

and got the same error message...

Offline

#5 2018-04-25 13:27:52

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

Same issue here after 3.5 update. Tried increasing "vm.swapiness", but with no luck:

install.packages('caret')

...

AlphaProcedure.o Common.o DKnn.o HD.o Knn.o LensDepth.o Mahalanobis.o OjaDepth.o Polynomial.o PotentialDepth.o ProjectionDepth.o SimplicialDepth.o TukeyDepth.o ZonoidDepth.o asa047.o ddalpha.o depth.fd.o init.o stdafx.o -lgfortran -lm -lquadmath -L/usr/lib64/R/lib -lR
installing to /home/keith/R/library/3.5/ddalpha/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in system2(file.path(R.home("bin"), "R"), c(if (nzchar(arch)) paste0("--arch=",  : 
  cannot popen ' '/usr/lib64/R/bin/R' --no-save --slave 2>&1 < '/tmp/RtmpfW0kGx/filec5311bd760'', probable reason 'Cannot allocate memory'
* removing ‘/home/keith/R/library/3.5/ddalpha’
Warning in q("no", status = status, runLast = FALSE) :
  system call failed: Cannot allocate memory
Calls: <Anonymous> -> do_exit_on_error -> do_exit -> q

During the "byte-compile" step, installation stalls for a minute or so while memory usage strangely increases by 3-4GB, which is much more than I've ever noticed in the past for an R package installation.

Couple other observations:

- Issue also occurrs with R-devel (3.6) on the same system.
- I checked another machine running Arch that is about a week behind (and still has R 3.4.4), and the package installed fine for by R and R-devel.

Cheers,
Keith

Offline

#6 2018-04-25 18:00:26

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

Cross posting: I just asked for help on Stack Overflow.

Offline

#7 2018-04-30 07:11:14

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

hughitt1 wrote:

Same issue here

I sent an email to the package maintainer. On macOS and Windows, the package does install, but it takes 4Gb of memory and takes several minutes to byte-compile. On older system, it crashes R. So the maintainer suspects that there is something wrong in their package design and he contacted the R core team, asking for advice on how to address this.

I will update here if I hear anything else.

Offline

#8 2018-05-01 02:35:23

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

Being unable to find a solution for this, I emailed the package maintainer. It turned out to be a bug: `ddalpha` byte-compiled extremely slowly and with the need a 4GB of RAM on Windows and macOS systems and the installation would fail altogether on linux systems.

The maintainer was phenomenal in contacting the R core team, looking for a fix, and getting back to me within 24 hours. The package is now fixed on CRAN and can be installed without issues.

Out of curiosity, I asked for details about the bug and will post here once I know more what the issue was.

Offline

#9 2018-05-01 03:59:54

hughitt1
Member
Registered: 2010-02-18
Posts: 82
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

That's great! Thanks for following the issue upstream and reporting back.

Offline

#10 2018-05-01 05:38:59

prosoitos
Member
Registered: 2018-03-31
Posts: 68
Website

Re: [SOLVED] Memory allocation problem while installing R package ddalpha

You're welcome smile

Offline

Board footer

Powered by FluxBB