[R] RAM Filling up

Thomas Allen hedbag at gmail.com
Fri Feb 29 23:44:01 CET 2008


Hi

I'm using Ubuntu 7.10 with 2GB RAM and a 2GB partition of the HDD set
aside as a swap drive.

I'm trying to write programs which are quite RAM intensive and as such
I sometimes run out of RAM and the process is killed.

At the moment I'm storing much data on disk, reading it in to a
datastructure, processing it, then writing it out again. Finally the
datastructure is removed with rm() in an effort to free up the RAM
before reading in more data.

Unfortunately, memory still fills up over time. It seems R copies
objects for various reasones and then doesn't release the memory
later.
Do I need to call gctorture() or something?

There should be a more clever way to manage memory allocation and
release in R (I just haven't found it yet).

Also, what's the best way to observe when R is releasing memory? Rprof
only seems to record memory allocations and not memory release (or am
I blind?)


What I'm really asking is what are some really informative memory
management tools for observing and controlling memory usage in R on a
unix based system?

Kind regards

Tom

-- 
Thomas Allen
Department of Biochemistry
University of Otago
email1: hedbag at gmail.com
email2: allth025 at student.otago.ac.nz
Work: (+64)3 479 5123
Mobile: 027 321 4269



More information about the R-help mailing list