[R] 1.2.2 under M$ windows 2000 lots of plots out of memory?

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Mar 12 18:57:34 CET 2001


Bob Sandefur wrote:
> 
> hi-
>  If I source the following
> 
> for(k in seq(1:20)){
> x<-runif(20000,min=-500,max=2000)
> y<-runif(20000,min=-500,max=2500)
> z<-runif(20000,min=-10,max=10)
> cat(k,"file",memory.size())
> cc<-rainbow(11)
> plot(x,y,asp=1i,xlim=c(-500,2000),ylim=c(-500,2500),main=k,cex=1.0)
> for(i in seq(-10,10,2)){
>  points(x[z > i],y[z > i],col=cc[(12+i)/2],cex=1.0)
>  }
> rm(x,y,z)
> cat(k,"fil2",memory.size(),"\n")
> #readline(prompt="enter for nextplot")
> dev.off()
> }
> ~
>  the check print gets to 256MB and R fails; I think I am freeing everthing with the rm(...) and dev.off().
> Am I failing to free something or force  r to do garbage collection?

Interesting. On NT4.0 R consumes about 20MB at all and does garbage
collection.
Output from you function:

1 file 94173681 fil2 14067880 
2 file 145127522 fil2 14284016 
3 file 120852243 fil2 13324928 
...
20 file 1329924020 fil2 12662432 


> I start r with
> 
> P:\r\base\rw1022\bin\rgui.exe --vsize=300M --nsize=20000k
> and turn of buffered output

These options are not neccessary in R-1.2.2, have a look at ?Memory:
"For backwards compatibility, options --nsize and --vsize are equivalent
to --min-nsize and --min-vsize. "
So you told R to use a minimal vsize of 300M.

On the other hand "The default [of max-mem-size] is the smaller of the
amount of physical RAM in the machine and 256Mb".

This explains it all, I think.

Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list