Bob Sandefur
2001-Mar-12 16:55 UTC
[R] 1.2.2 under M$ windows 2000 lots of plots out of memory?
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? I start r with P:\r\base\rw1022\bin\rgui.exe --vsize=300M --nsize=20000k and turn of buffered output I may have a hosed up windows 2000 installation as hibernating with R running on my acer 350 gives the blue screen of death (The only blue screen of death I've ever had on the updated 2000) thanx Rober L Sandefur Principal Geostatistician Pincock Allen & Holt (A Hart Crowser Company) International Minerals Consultants 274 Union Suite 200 Lakewood CO 80228 USA 303 914-4467 v 303 987-8907 f -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thomas Lumley
2001-Mar-12 17:43 UTC
[R] 1.2.2 under M$ windows 2000 lots of plots out of memory?
On Mon, 12 Mar 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? > > I start r with > > P:\r\base\rw1022\bin\rgui.exe --vsize=300M --nsize=20000k > and turn of buffered outputWell, that's the problem. You are asking R to allocate 300Mb of heap and 20 million cons cells (at 28 bytes each) at startup, for a total of about 800Mb of memory. This means there's no need for garbage collection until you reach 800Mb of memory. If you don't have 800Mb of memory it isn't surprising that this doesn't work well. Under NT with R1.2.0 the memory grows without any garbage collection if I specify a huge memory size as you did. If I don't, the memory stays at about 12Mb. There is a slight increase of about 2k on each iteration, but this would probably be garbage collected when it got big. Under R1.2 and more recently you don't have to specify memory size; R can allocate dynamically. You can specify minimum and maximum sizes, and if you use the old --vsize notation you are specifying the minimum. The only real need for specifying memory nowadays is to stop R taking over the computer: you can specify maximum sizes that are enough smaller than the physical memory to make sure other processes can run. -thomas Thomas Lumley Asst. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian Ripley
2001-Mar-12 17:46 UTC
[R] 1.2.2 under M$ windows 2000 lots of plots out of memory?
Try reading the rw-FAQ and ?Memory for memory management under 1.2.x. What you have done is the problem: you have requested a heap bigger than the maximum allowed memory. [...]> P:\r\base\rw1022\bin\rgui.exe --vsize=300M --nsize=20000kThat turned off garbage collection until well over 300M, but the default memory limit is 256M. What did you think you were doing? Really! -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Uwe Ligges
2001-Mar-12 17:57 UTC
[R] 1.2.2 under M$ windows 2000 lots of plots out of memory?
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 outputThese 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Vadim Ogranovich
2001-Mar-12 20:42 UTC
[R] 1.2.2 under M$ windows 2000 lots of plots out of memory?
Unfortunately, I don't have 1.2.x installed so I can not read ?Memory, but your e-mail seems to suggest that one can not have a workpspace bigger than 256M no matter how much RAM the computer has. Am I reading you correctly? Thanks, Vadim -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: Monday, March 12, 2001 9:47 AM To: Bob Sandefur Cc: r-help at stat.math.ethz.ch Subject: Re: [R] 1.2.2 under M$ windows 2000 lots of plots out of memory? Try reading the rw-FAQ and ?Memory for memory management under 1.2.x. What you have done is the problem: you have requested a heap bigger than the maximum allowed memory. [...]> P:\r\base\rw1022\bin\rgui.exe --vsize=300M --nsize=20000kThat turned off garbage collection until well over 300M, but the default memory limit is 256M. What did you think you were doing? Really! -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._