Hi all, I've got a script that I run on several computers, some with much less ram than others, and I would like to try and keep the memory usage as low as possible. The script creates variables to store intermediate results of calculations, and then at the end writes a text file with the results of the calculations. Is a quick and dirty way to accomplish this to use rm() to delete objects no longer in use, and then run gc()? ...or is there a better way? Thanks in advance, Ken
On 7/14/2005 9:46 AM, Ken Termiso wrote:> Hi all, > > I've got a script that I run on several computers, some with much less ram > than others, and I would like to try and keep the memory usage as low as > possible. The script creates variables to store intermediate results of > calculations, and then at the end writes a text file with the results of the > calculations. > > Is a quick and dirty way to accomplish this to use rm() to delete objects no > longer in use, and then run gc()? ...or is there a better way?Using rm() is good. gc() will run automatically as needed; the main reason to run it yourself is just to make calculation timings more reproducible. It will also affect memory fragmentation, most likely beneficially, but not necessarily... Duncan Murdoch
Reasonably Related Threads
- Rounding fractional numbers to nearest fraction
- Problem building/checking library that requires input from user
- Any way to add to data frame saved as .rData file?
- Isolating string containing only file name from complete path
- ordering a data frame to same order as a chr vector