[R] vector memory allocation?

From: Sam Yeaman <yeaman_at_zoology.ubc.ca>
Date: Sat 05 Mar 2005 - 11:08:59 EST


Hi all,

I have a vector size allocation problem with R 2.0.1 (script and output shown):

> var1 <- sum (input1 * input2, na = TRUE)

> gc()

           used  (Mb) gc trigger   (Mb)
Ncells   199327   5.4     785113   21.0 
Vcells 71039552 542.0 206003790 1571.7

> var2 <- sum (input1 * input2 / input2, na = TRUE)

Error: cannot allocate vector of size 524288 Kb

input1 and input2 are matrices input from text files of about 100 MB.

This error happens irrespective of whether I calculate var1 or var2 first...it will always calculate the first and always have an error on the second. Am I misusing the garbage-collector? I am confused by the fact that the difference between 'trigger' and 'used' seems so much higher than the size of vector that it says it can't allocate.

thanks, Sam Yeaman



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Mar 05 11:17:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:41 EST