Determining memory usage of objects?

Josh Reich picture Josh Reich · Sep 8, 2009 · Viewed 73.6k times · Source

I'd like to work out how much RAM is being used by each of my objects inside my current workspace. Is there an easy way to do this?

Answer

JD Long picture JD Long · Sep 8, 2009

some time ago I stole this little nugget from here:

sort( sapply(ls(),function(x){object.size(get(x))})) 

it has served me well