Could anyone advise me how to allocate 1.5Gbyte memory for R on a Dell laptop running XP professional with 2G memory? I have tried "C:\Program Files\R\rw1081\bin\Rgui.exe" --max-vsize=1400M but I only get only 500MB for R actually. I also tried memory.limit(2^30) in R and got error of: Error in memory.size(size) : cannot decrease memory limit Yi-Xiong [[alternative HTML version deleted]]
Yi-Xiong Sean Zhou wrote:> > Could anyone advise me how to allocate 1.5Gbyte memory for R on a Dell > laptop running XP professional with 2G memory?See ?Memory or the the R for Windows FAQ, which tells you: "2.7 There seems to be a limit on the memory it uses! Indeed there is. It is set by the command-line flag --max-mem-size (see How do I install R for Windows?) and defaults to the smaller of the amount of physical RAM in the machine and 1Gb. [...]"> I have tried > > "C:\Program Files\R\rw1081\bin\Rgui.exe" --max-vsize=1400M > > but I only get only 500MB for R actually. > > > I also tried memory.limit(2^30) in R and got error of:Well, you don't want to allocate 2^30 *Mega*Bytes (see ?memory.limit), do you? Either use the command line flag --max-mem-size=1500M or within R: memory.limit(1500)> > Error in memory.size(size) : cannot decrease memory limitSince your limit was roughly 10^6-times off the right one, you got an integer overflow internally, I think. Uwe Ligges> Yi-Xiong > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
If you check the max memory used, I bet it is the same as your memory.limit. Try memory.size(max=TRUE) to see how much memory was allocated. You also might try --max-mem-size=2000M. R will not actually be able to get all 2 Gb of ram, but I think it will be more than 1.5 Gb you are allowing now. Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623>>> "Yi-Xiong Sean Zhou" <yzhou at sdsc.edu> 04/03/04 04:49PM >>>After memory.limit(1500), the error message still pop out: Error: cannot allocate vector of size 11529 Kb While> memory.size()[1] 307446696> memory.limit()[1] 1572864000 And the system is only using 723MB physical memory, while 2G is the total. Does anyone have a clue of what is going on? Yi-Xiong -----Original Message----- From: Uwe Ligges [mailto:ligges at statistik.uni-dortmund.de] Sent: Saturday, April 03, 2004 12:40 PM To: Yi-Xiong Sean Zhou Cc: r-help at stat.math.ethz.ch Subject: Re: [R] memory limit problem Yi-Xiong Sean Zhou wrote:> > Could anyone advise me how to allocate 1.5Gbyte memory for R on aDell> laptop running XP professional with 2G memory?See ?Memory or the the R for Windows FAQ, which tells you: "2.7 There seems to be a limit on the memory it uses! Indeed there is. It is set by the command-line flag --max-mem-size (see How do I install R for Windows?) and defaults to the smaller of the amount of physical RAM in the machine and 1Gb. [...]"> I have tried > > "C:\Program Files\R\rw1081\bin\Rgui.exe" --max-vsize=1400M > > but I only get only 500MB for R actually. > > > I also tried memory.limit(2^30) in R and got error of:Well, you don't want to allocate 2^30 *Mega*Bytes (see ?memory.limit), do you? Either use the command line flag --max-mem-size=1500M or within R: memory.limit(1500)> > Error in memory.size(size) : cannot decrease memory limitSince your limit was roughly 10^6-times off the right one, you got an integer overflow internally, I think. Uwe Ligges> Yi-Xiong > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Do you mean in Linux, there is no need to set memory limit? If needed, how to set it? Thanks.>From: "Roger D. Peng" <rpeng at jhsph.edu> >To: Yi-Xiong Sean Zhou <yzhou at sdsc.edu> >CC: r-help at stat.math.ethz.ch >Subject: Re: [R] memory limit problem >Date: Sun, 04 Apr 2004 00:13:46 -0500 > >In general, this is not an R problem, it is a Windows problem. I find that >these types of memory problems do not appear on Linux, for example. > >-roger > >Yi-Xiong Sean Zhou wrote: >>R1.9.0beta solves the problem for now. The memory foot print of R1.9.0 is >>way smaller than R1.8.1, with only 400M. It will be interesting to see how >>R1.9.0 handles the memory problem when it needs more than 700M. >> >>Thanks for your helps. >> >>Yi-Xiong >> >>-----Original Message----- >>From: Roger D. Peng [mailto:rpeng at jhsph.edu] Sent: Saturday, April 03, >>2004 2:52 PM >>To: Yi-Xiong Sean Zhou >>Cc: 'Uwe Ligges'; r-help at stat.math.ethz.ch >>Subject: Re: [R] memory limit problem >> >>You may want to try downloading the development version of R at >>http://cran.us.r-project.org/bin/windows/base/rdevel.html. This version >>deals with Windows' deficiencies in memory management a little better. >> >>-roger >> >>Yi-Xiong Sean Zhou wrote: >> >> >>>After memory.limit(1500), the error message still pop out: >>> >>>Error: cannot allocate vector of size 11529 Kb >>> >>>While >>> >>> >>> >>>>memory.size() >>> >>>[1] 307446696 >>> >>> >>>>memory.limit() >>> >>>[1] 1572864000 >>> >>>And the system is only using 723MB physical memory, while 2G is the >>>total. >> >> >>>Does anyone have a clue of what is going on? >>> >>> >>>Yi-Xiong >>> >>> >>>-----Original Message----- >>>From: Uwe Ligges [mailto:ligges at statistik.uni-dortmund.de] Sent: >>>Saturday, April 03, 2004 12:40 PM >>>To: Yi-Xiong Sean Zhou >>>Cc: r-help at stat.math.ethz.ch >>>Subject: Re: [R] memory limit problem >>> >>> >>> >>>Yi-Xiong Sean Zhou wrote: >>> >>> >>>>Could anyone advise me how to allocate 1.5Gbyte memory for R on a Dell >>>>laptop running XP professional with 2G memory? >>> >>> >>>See ?Memory or the the R for Windows FAQ, which tells you: >>> >>>"2.7 There seems to be a limit on the memory it uses! >>> >>>Indeed there is. It is set by the command-line flag --max-mem-size (see >>>How do I install R for Windows?) and defaults to the smaller of the >>>amount of physical >>>RAM in the machine and 1Gb. [...]" >>> >>> >>> >>> >>>>I have tried >>>> >>>>"C:\Program Files\R\rw1081\bin\Rgui.exe" --max-vsize=1400M >>>> >>>>but I only get only 500MB for R actually. >>>> >>>> >>>>I also tried memory.limit(2^30) in R and got error of: >>> >>> >>>Well, you don't want to allocate 2^30 *Mega*Bytes (see ?memory.limit), >>>do you? >>> >>> >>>Either use the command line flag --max-mem-size=1500M or within R: >>>memory.limit(1500) >>> >>> >>> >>> >>>>Error in memory.size(size) : cannot decrease memory limit >>> >>> >>>Since your limit was roughly 10^6-times off the right one, you got an >>>integer overflow internally, I think. >>> >>>Uwe Ligges >>> >>> >>> >>> >>> >>>>Yi-Xiong >>>> >>>> [[alternative HTML version deleted]] >>>> >>>>______________________________________________ >>>>R-help at stat.math.ethz.ch mailing list >>>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help >>>>PLEASE do read the posting guide! >>> >>>http://www.R-project.org/posting-guide.html >>> >>>______________________________________________ >>>R-help at stat.math.ethz.ch mailing list >>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help >>>PLEASE do read the posting guide! >> >>http://www.R-project.org/posting-guide.html >> >> >> > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html
On Linux, you can set memory limits in the shell you use to run R (via command limit or ulimit, depending on the shell). Yes, there can be a need to set memory limits on Linux too. However, the problem was that (apparently, as we have not had a clear report), the available memory was not all being used, and that is not seen on Linux (or Solaris or ...). On Mon, 5 Apr 2004, Z P wrote:> Do you mean in Linux, there is no need to set memory limit? If needed, how > to set it? Thanks.> >From: "Roger D. Peng" <rpeng at jhsph.edu> > > > >In general, this is not an R problem, it is a Windows problem. I find that > >these types of memory problems do not appear on Linux, for example.-- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
we have two server, one is unix (1280M) and linux (2319872k), how can I set the max? for the Linux one, R --max-vsize=2319872k --max-nsize=2319872k Then I use>mem.limits()nsize vsize NA NA It seems the limits are not set at all I want to define an array>a<-array(0,rep(2,28))Error: cannot allocate vector of size 2097152 Kb next I type>a<-array(0,rep(2,27))It is ok. then>a<-array(0,rep(2,28))Error: vector memory exhausted (limit reached?) Is there any way to help? In fact, I am now using some array(0,rep(2,21)), the program run some time then fail, I can not trace what happened since I run R in batchs under Linux. Does this happen probably due to the memory exhaust? (for some array(0,rep(2,10)), my codes work well).>From: Prof Brian Ripley <ripley at stats.ox.ac.uk> >To: Z P <nusbj at hotmail.com> >CC: r-help at stat.math.ethz.ch >Subject: Re: [R] memory limit problem >Date: Mon, 5 Apr 2004 07:12:02 +0100 (BST) > >On Linux, you can set memory limits in the shell you use to run R (via >command limit or ulimit, depending on the shell). > >Yes, there can be a need to set memory limits on Linux too. However, the >problem was that (apparently, as we have not had a clear report), the >available memory was not all being used, and that is not seen on Linux (or >Solaris or ...). > >On Mon, 5 Apr 2004, Z P wrote: > > > Do you mean in Linux, there is no need to set memory limit? If needed, >how > > to set it? Thanks. > > > >From: "Roger D. Peng" <rpeng at jhsph.edu> > > > > > >In general, this is not an R problem, it is a Windows problem. I find >that > > >these types of memory problems do not appear on Linux, for example. > >-- >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 272866 (PA) >Oxford OX1 3TG, UK Fax: +44 1865 272595 > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html
Z P wrote:> we have two server, one is unix (1280M) and linux (2319872k), how can I > set the max? > > for the Linux one, > > R --max-vsize=2319872k --max-nsize=2319872k > > Then I use > >> mem.limits() > > nsize vsize > NA NA > > It seems the limits are not set at all > > I want to define an array > >> a<-array(0,rep(2,28))Well, you need 4 * 2^28 = 1073741824 Byte to store the data for that array (if numeric). Internally, the data will probably be copied at least once from one object to another, so already consuming ~ 2Gb and you have reached the limit in this case. I am not surprised. Uwe Ligges> Error: cannot allocate vector of size 2097152 Kb > > next I type > >> a<-array(0,rep(2,27)) > > > It is ok. then > >> a<-array(0,rep(2,28)) > > Error: vector memory exhausted (limit reached?) > > Is there any way to help? In fact, I am now using some > array(0,rep(2,21)), the program run some time then fail, I can not trace > what happened since I run R in batchs under Linux. Does this happen > probably due to the memory exhaust? (for some array(0,rep(2,10)), my > codes work well). > > > > >> From: Prof Brian Ripley <ripley at stats.ox.ac.uk> >> To: Z P <nusbj at hotmail.com> >> CC: r-help at stat.math.ethz.ch >> Subject: Re: [R] memory limit problem >> Date: Mon, 5 Apr 2004 07:12:02 +0100 (BST) >> >> On Linux, you can set memory limits in the shell you use to run R (via >> command limit or ulimit, depending on the shell). >> >> Yes, there can be a need to set memory limits on Linux too. However, the >> problem was that (apparently, as we have not had a clear report), the >> available memory was not all being used, and that is not seen on Linux >> (or >> Solaris or ...). >> >> On Mon, 5 Apr 2004, Z P wrote: >> >> > Do you mean in Linux, there is no need to set memory limit? If >> needed, how >> > to set it? Thanks. >> >> > >From: "Roger D. Peng" <rpeng at jhsph.edu> >> > > >> > >In general, this is not an R problem, it is a Windows problem. I >> find that >> > >these types of memory problems do not appear on Linux, for example. >> >> -- >> 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 272866 (PA) >> Oxford OX1 3TG, UK Fax: +44 1865 272595 >> >> ______________________________________________ >> R-help at stat.math.ethz.ch mailing list >> https://www.stat.math.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! >> http://www.R-project.org/posting-guide.html > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html