[R] "cannot allocate vector of size ..." in RHLE5 PAE kernel

Mauricio Zambrano hzambran.newsgroups at gmail.com
Mon Jan 17 16:42:43 CET 2011


Following the advice a colleague, I put the gc() and gcinfo(TRUE)
commands just before the line I got the problem, and their output
were:

                 used (Mb) gc trigger  (Mb)  max used   (Mb)
Ncells  471485 12.6    1704095  45.6   7920371  211.5
Vcells 6408885 48.9  113919753 869.2 347651599 2652.4

Garbage collection 538 = 323+101+114 (level 2) ...
13.0 Mbytes of cons cells used (29%)
49.0 Mbytes of vectors used (7%)

Error: cannot allocate vector of size 238.1 Mb


If I understood correctly, I should have enough memory for allocating
the new matrix (Q.obs <- matrix(NA, nrow=6940,  MZ> ncol=9000) ))

Thanks in advance for any help,

Mauricio


-- 
===============================
Linux user #454569 -- Ubuntu user #17469
===============================

2011/1/17 Martin Maechler <maechler at stat.math.ethz.ch>:
>>>>>> "MZ" == Mauricio Zambrano <hzambran.newsgroups at gmail.com>
>>>>>>     on Mon, 17 Jan 2011 11:46:44 +0100 writes:
>
>    MZ> Dear R community,
>    MZ> I'm running R 32 bits in a 64-bits machine (with 16Gb of Ram) using a
>    MZ> PAE kernel, as you can see here:
>
>    MZ> $ uname -a
>    MZ> Linux mymachine 2.6.18-238.el5PAE #1 SMP Sun Dec 19 14:42:44 EST 2010
>    MZ> i686 i686 i386 GNU/Linux
>
>
>    MZ> When I try to create a large matrix ( Q.obs <- matrix(NA, nrow=6940,
>    MZ> ncol=9000) ), I got the following error:
>
>
>    >> Error: cannot allocate vector of size 238.3 Mb
>
>
>    MZ> However, the amount of free memory in my machine seems to be much
>    MZ> larger than this:
>
>    MZ> system("free")
>    MZ> \             total       used       free     shared    buffers     cached
>    MZ> Mem:      12466236    6354116    6112120          0      67596    2107556
>    MZ> -/+ buffers/cache:    4178964    8287272
>    MZ> Swap:     12582904          0   12582904
>
>
>    MZ> I tried to increase the memory limit available for R by using:
>
>    MZ> $ R --min-vsize=10M --max-vsize=5000M --min-nsize=500k --max-nsize=5000M
>
>
>    MZ> but it didn't work.
>
>
>    MZ> Any hint about how can I get R using all the memory available in the machine ?
>
> Install a 64-bit version of Linux, i.e., ubuntu in your case
> and work from there.
> I don't think there's a way around that.
>
> Martin
>



More information about the R-help mailing list