Recursively, runs objSize on the simList environment, so it estimates the correct size of functions stored there (e.g., with their enclosing environments) plus, it adds all other "normal" elements of the simList, e.g., objSize(completed(sim)).

# S3 method for simList
objSize(
  x,
  quick = getOption("reproducible.quick", FALSE),
  enclosingEnvs = TRUE,
  .prevEnvirs = list(),
  ...
)

Arguments

x

An object

quick

Logical. Only some methods use this. e.g., Path class objects. In which case, file.size will be used instead of object.size.

enclosingEnvs

Logical indicating whether to include enclosing environments. Default TRUE.

.prevEnvirs

For internal account keeping to identify and prevent duplicate counting

...

Additional arguments (currently unused)

Examples

a <- simInit(objects = list(d = 1:10, b = 2:20))
#> Setting: #> options( #> rasterTmpDir = '/private/var/folders/l2/hy6b0sl977bcd8695nt6j7s80000gn/T/RtmpRqC26y/raster' #> reproducible.cachePath = '/private/var/folders/l2/hy6b0sl977bcd8695nt6j7s80000gn/T/RtmpRqC26y/myProject/cache' #> spades.inputPath = '/private/var/folders/l2/hy6b0sl977bcd8695nt6j7s80000gn/T/RtmpRqC26y/myProject/inputs' #> spades.outputPath = '/private/var/folders/l2/hy6b0sl977bcd8695nt6j7s80000gn/T/RtmpRqC26y/myProject/outputs' #> spades.modulePath = '/private/var/folders/l2/hy6b0sl977bcd8695nt6j7s80000gn/T/RtmpRqC26y/myProject/modules' #> )
objSize(a)
#> $`x@.xData$b` #> 176 bytes #> #> $`x@.xData$d` #> 96 bytes #> #> $`x@.xData$.userSuppliedObjNames` #> 176 bytes #> #> $`x@.xData$.mods` #> $`x@.xData$.mods`$y #> 56 bytes #> #> #> $`x@.xData` #> 280 bytes #> #> $simListWithoutObjects #> $simListWithoutObjects[[1]] #> $simListWithoutObjects[[1]][[1]] #> 120 bytes #> #> $simListWithoutObjects[[1]][[2]] #> 112 bytes #> #> $simListWithoutObjects[[1]][[3]] #> 120 bytes #> #> $simListWithoutObjects[[1]][[4]] #> 112 bytes #> #> #> $simListWithoutObjects[[2]] #> $simListWithoutObjects[[2]]$.checkpoint #> $simListWithoutObjects[[2]]$.checkpoint$interval #> 56 bytes #> #> $simListWithoutObjects[[2]]$.checkpoint$file #> 0 bytes #> #> #> $simListWithoutObjects[[2]]$.progress #> $simListWithoutObjects[[2]]$.progress$type #> 56 bytes #> #> $simListWithoutObjects[[2]]$.progress$interval #> 56 bytes #> #> #> #> $simListWithoutObjects[[3]] #> $simListWithoutObjects[[3]][[1]] #> $simListWithoutObjects[[3]][[1]]$eventTime #> 280 bytes #> #> $simListWithoutObjects[[3]][[1]]$moduleName #> 120 bytes #> #> $simListWithoutObjects[[3]][[1]]$eventType #> 112 bytes #> #> $simListWithoutObjects[[3]][[1]]$eventPriority #> 56 bytes #> #> #> $simListWithoutObjects[[3]][[2]] #> $simListWithoutObjects[[3]][[2]]$eventTime #> 280 bytes #> #> $simListWithoutObjects[[3]][[2]]$moduleName #> 112 bytes #> #> $simListWithoutObjects[[3]][[2]]$eventType #> 112 bytes #> #> $simListWithoutObjects[[3]][[2]]$eventPriority #> 56 bytes #> #> #> $simListWithoutObjects[[3]][[3]] #> $simListWithoutObjects[[3]][[3]]$eventTime #> 280 bytes #> #> $simListWithoutObjects[[3]][[3]]$moduleName #> 120 bytes #> #> $simListWithoutObjects[[3]][[3]]$eventType #> 112 bytes #> #> $simListWithoutObjects[[3]][[3]]$eventPriority #> 56 bytes #> #> #> $simListWithoutObjects[[3]][[4]] #> $simListWithoutObjects[[3]][[4]]$eventTime #> 280 bytes #> #> $simListWithoutObjects[[3]][[4]]$moduleName #> 112 bytes #> #> $simListWithoutObjects[[3]][[4]]$eventType #> 112 bytes #> #> $simListWithoutObjects[[3]][[4]]$eventPriority #> 56 bytes #> #> #> #> $simListWithoutObjects[[4]] #> $simListWithoutObjects[[4]]$y #> 56 bytes #> #> #> $simListWithoutObjects[[5]] #> 688 bytes #> #> $simListWithoutObjects[[6]] #> $simListWithoutObjects[[6]]$current #> 280 bytes #> #> $simListWithoutObjects[[6]]$start #> 280 bytes #> #> $simListWithoutObjects[[6]]$end #> 280 bytes #> #> $simListWithoutObjects[[6]]$timeunit #> 112 bytes #> #> #> $simListWithoutObjects[[7]] #> 1792 bytes #> #> $simListWithoutObjects[[8]] #> 1704 bytes #> #> $simListWithoutObjects[[9]] #> $simListWithoutObjects[[9]]$cachePath #> 232 bytes #> #> $simListWithoutObjects[[9]]$inputPath #> 232 bytes #> #> $simListWithoutObjects[[9]]$modulePath #> 232 bytes #> #> $simListWithoutObjects[[9]]$outputPath #> 232 bytes #> #> $simListWithoutObjects[[9]]$rasterPath #> 232 bytes #> #> #>
utils::object.size(a)
#> 17144 bytes