[R] "cannot allocate vector of size ..." in RHLE5 PAE kernel
Mauricio Zambrano
hzambran.newsgroups at gmail.com
Wed Jan 19 12:54:38 CET 2011
Dear Hugo,
I tried your memory test program (without further modifications) just
after the gc() command:
print(gc())
print(gcinfo(TRUE))
system("/mypath/memorytest.out")
and the result that I got was:
Number of simulations read from ' Particles.txt ' : 9000
-------------------------------------------------------------------
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 480114 12.9 1816453 48.6 5543382 148.1
Vcells 5256970 40.2 119171871 909.3 322607910 2461.4
[1] TRUE
Trying to allocate 1000000000 bytes ... success. Now trying to commit
memory ... succeeded.
Garbage collection 2667 = 2286+194+187 (level 2) ...
12.9 Mbytes of cons cells used (26%)
278.4 Mbytes of vectors used (29%)
Error: cannot allocate vector of size 476.2 Mb
What do you understand of this result ?
Thanks in advance,
Mauricio
--
===============================
Linux user #454569 -- Ubuntu user #17469
===============================
2011/1/19 Hugo Mildenberger <Hugo.Mildenberger at web.de>:
>> I got the following warning:
>> memorytest.c: In function ‘main’:
>> memorytest.c:5: warning: return type of ‘main’ is not ‘int’
>> Is this important ?
>
> Hello Mauricio,
>
> No, your gcc version is unduly puristic here. The traditional return
> type of the main function in "C" should be "int", and if that is given,
> main has to return an integer number explicitly. By convention,
> a main function returning 0 indicates success, and anything other
> is considered as an error or warning condition. Specifying "void main()"
> normally implies returning zero. But if you are still worried simply
> change "void main" into "int main()" and add the statement " return 0; "
> just before the last curly bracket (without quotation marks, of course):
>
> int main() {
> [...]
> return 0;
> }
>
> Best
>
> Hugo
>
More information about the R-help
mailing list