wanr@ucalgary.ca
2004-Sep-30 16:52 UTC
[R] Is there any way to release memory in running time?
Hi all, I am doing some intensive computation right now. My system is Pentium4 3.20G + 1.0G RAM + WindowsXP + R1.9.1. It seems my computer is very powerful. However, when I do some simple matrix algebra operations based on a matrix (DD) with dimension 5000000 by 2, I found that the consumption of RAM is huge. For example, the command a <- 1 - DD[,2] eats my 100M RAM. Does anyone know how to release memory in the middle of program (running time)? BTW, the command rm() does not free memory unless you quit R as I as know. Thanks in advance. Rui
See ?gc. Sean On Sep 30, 2004, at 12:52 PM, <wanr at ucalgary.ca> wrote:> Hi all, > > I am doing some intensive computation right now. My system is Pentium4 > 3.20G > + 1.0G RAM + WindowsXP + R1.9.1. It seems my computer is very powerful. > However, when I do some simple matrix algebra operations based on a > matrix > (DD) with dimension 5000000 by 2, I found that the consumption of RAM > is > huge. For example, the command a <- 1 - DD[,2] eats my 100M RAM. Does > anyone > know how to release memory in the middle of program (running time)? > BTW, the > command rm() does not free memory unless you quit R as I as know. > Thanks in > advance. > > Rui > > ______________________________________________ > R-help at 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
Witold Eryk Wolski
2004-Sep-30 17:06 UTC
[R] Is there any way to release memory in running time?
?gc /E wanr at ucalgary.ca wrote:>Hi all, > >I am doing some intensive computation right now. My system is Pentium4 3.20G >+ 1.0G RAM + WindowsXP + R1.9.1. It seems my computer is very powerful. >However, when I do some simple matrix algebra operations based on a matrix >(DD) with dimension 5000000 by 2, I found that the consumption of RAM is >huge. For example, the command a <- 1 - DD[,2] eats my 100M RAM. Does anyone >know how to release memory in the middle of program (running time)? BTW, the >command rm() does not free memory unless you quit R as I as know. Thanks in >advance. > >Rui > >______________________________________________ >R-help at 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 > > >-- Dipl. bio-chem. Witold Eryk Wolski MPI-Moleculare Genetic Ihnestrasse 63-73 14195 Berlin _ tel: 0049-30-83875219 'v' http://www.molgen.mpg.de/~wolski / \ mail: witek96 at users.sourceforge.net ---W-W---- wolski at molgen.mpg.de
Roger D. Peng
2004-Sep-30 17:31 UTC
[R] Is there any way to release memory in running time?
I'm not sure I understand your problem. Your `DD' matrix should occupy ~75MB of memory and your `a' vector should occupy ~38MB of memory. That adds up to over 100MB as far as I can see. As far as I know, there is no way to explicitly give memory back to the *operating system*, if that's what you need. -roger wanr at ucalgary.ca wrote:> Hi all, > > I am doing some intensive computation right now. My system is Pentium4 3.20G > + 1.0G RAM + WindowsXP + R1.9.1. It seems my computer is very powerful. > However, when I do some simple matrix algebra operations based on a matrix > (DD) with dimension 5000000 by 2, I found that the consumption of RAM is > huge. For example, the command a <- 1 - DD[,2] eats my 100M RAM. Does anyone > know how to release memory in the middle of program (running time)? BTW, the > command rm() does not free memory unless you quit R as I as know. Thanks in > advance. > > Rui > > ______________________________________________ > R-help at 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 >