[R] Memory usage reported by gc() differs from 'top'

Kjetil Kjernsmo kjekje at ifi.uio.no
Thu Apr 18 23:17:19 CEST 2013


On Thursday 18. April 2013 12.18.03 Milan Bouchet-Valat wrote:
> First, completely stop looking at virtual memory: it does not mean much, if
> anything. What you care about is resident memory. See e.g.:
> http://serverfault.com/questions/138427/top-what-does-virtual-memory-size-m
> ean-linux-ubuntu

I concur. I have lost track of R's internals long ago, but in a previous life 
analyzing the Apache HTTP server's actual memory use (something that focused 
on shared RAM, quite different from what you'd probably like to do), I found 
that if you really need to understand what's going on, you would need to look 
elsewhere. 

On Linux, you'll find the details in the /proc/[pid]/maps and /proc/[pid]/smaps 
pseudo-filesystem files, where [pid] is the process ID, im your example 6210. 
That's where you really see what's eating your RAM. :-)

Cheers,

KJetil



More information about the R-help mailing list