Rev 27442 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{object.size}\alias{object.size}\title{Report the Space Allocated for an Object}\description{Provides an estimate of the memory that is being used to store an \R object.}\usage{object.size(x)}\arguments{\item{x}{An \R object.}}\details{Exactly which parts of the memory allocation should be attributedto which object is not clear-cut. This function merely providesa rough indication. For example, it will not detect if characterstorage for character strings are shared between identical elements(which it will be if \code{rep} was used, for example).The calculation is of the size of the object, and excludes the spaceneeded to store its name in the symbol table.}\value{An estimate of the memory allocation attributable to the object, in bytes.}\examples{object.size(letters)object.size(ls)## find the 10 largest objects in basez <- sapply(ls("package:base"), function(x) object.size(get(x, envir=NULL)))as.matrix(rev(sort(z))[1:10])}\keyword{utilities}