This question already has an answer here:
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?
This question already has an answer here:
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?
1. by object size
to get memory allocation on an object-by-object basis, call object.size() and pass in the object of interest:
(unless the argument passed in is a variable, it must be quoted, or else wrapped in a get call.)variable name, then omit the quotes,
you can loop through your namespace and get the size of all of the objects in it, like so:
2. by object type
to get memory usage for your namespace, by object type, use memory.profile()
(There's another function, memory.size() but i have heard and read that it only seems to work on Windows. It just returns a value in MB; so to get max memory used at any time in the session, use memory.size(max=T)).
some time ago I stole this little nugget from here:
it has served me well
This question was posted and got legitimate answers so much ago, but I want to let you know another useful tips to get the size of an object using a library called gdata and its
ll()
function.You could try the
lsos()
function from this question: