[R] RAM Filling up

From: Thomas Allen <hedbag_at_gmail.com>
Date: Sat, 01 Mar 2008 11:44:01 +1300


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


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

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 29 Feb 2008 - 23:00:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 01 Mar 2008 - 00:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive