showObjectsSize.Rd
showObjectsSize
shows how much memory do objects in specific
environment(s) occupy. It builds upon object.size
and
gathers information about the size and mode of objects in specific
environment(s). It supports environment name filtering using regular
expressions, object mode filtering, as well as filtering by size.
showObjectsSize(mode = NULL, n = 20, env = parent.frame(), recursive = FALSE, envNameRegexpr = NULL, all.names = TRUE, sizeUnits = 1024 * 1024, verbose = FALSE)
mode | mode of objects to show (see 'mode'), use codeNULL to show objects of all modes. |
---|---|
n | number of objects to show (the first |
env | environment to operate in. |
recursive | shall we iteratively look in parent environments? |
envNameRegexpr | regular expression character filter applied
to the names of environments. If not |
all.names | if |
sizeUnits | the units of size (defaults to 1MB) |
verbose | if |
Partially based on http://jeromyanglim.blogspot.cz/2009/11/memory-management-in-r-few-tips-and.html.
A data frame of columns name
, size
, mode
,
and env
.
In addition, the total size of all objects found is put into
the totalSize
attribute of the data frame.
showObjectsSize(n=20)#> [1] name size type mode class rows cols env #> <0 rows> (or 0-length row.names)if (require('MASS')) { showObjectsSize(mode = 'numeric', envNameRegexpr = glob2rx('package:MASS'), rec = TRUE) }#> name size type mode class rows cols env #> 18 SP500 0.0212554932 double numeric numeric 2780 NA package:MASS #> 59 drivers 0.0019073486 double numeric ts 192 NA package:MASS #> 28 accdeaths 0.0009918213 double numeric ts 72 NA package:MASS #> 56 deaths 0.0009918213 double numeric ts 72 NA package:MASS #> 72 galaxies 0.0006713867 double numeric numeric 82 NA package:MASS #> 119 newcomb 0.0005493164 double numeric numeric 66 NA package:MASS #> 27 abbey 0.0002822876 double numeric numeric 31 NA package:MASS #> 45 chem 0.0002288818 double numeric numeric 24 NA package:MASS #> 145 shrimp 0.0001831055 double numeric numeric 18 NA package:MASS #> 7 DDT 0.0001678467 double numeric numeric 15 NA package:MASS