[R] memory management

Bert Gunter gunter.berton at gene.com
Mon Feb 27 23:35:14 CET 2012

This appears to be the sort of query that (with apologies to other R
gurus) only Brian Ripley or Luke Tierney could figure out. R generally
passes by value into function calls (but not *always*), so often
multiple copies of objects are made during the course of calls. I
would speculate that this is what might be going on below -- maybe
even that's what you meant.

Just a guess on my part, of course, so treat accordingly.

-- Bert

On Mon, Feb 27, 2012 at 1:03 PM, Sam Steingold <sds at gnu.org> wrote:
> It appears that the intermediate data in functions is never GCed even
> after the return from the function call.
> R's RSS is 4 Gb (after a gc()) and
> sum(unlist(lapply(lapply(ls(),get),object.size)))
> [1] 1009496520
> (less than 1 GB)
> how do I figure out where the 3GB of uncollected garbage is hiding?
> --
> Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
> http://www.childpsy.net/ http://camera.org http://truepeace.org
> http://www.PetitionOnline.com/tap12009/ http://thereligionofpeace.com
> Modern man is the missing link between apes and human beings.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374

More information about the R-help mailing list