Reputation: 23134
Apparently object.size
does not work here:
> e = new.env()
> e$a = 1:10000
> e$b = 1:10000
> object.size(e)
56 bytes
> e$c = 1:10000
> object.size(e)
56 bytes
Upvotes: 1
Views: 465
Reputation: 50744
Use object_size
function from pryr package:
> library(pryr)
> e = new.env()
> e$a = 1:10000
> e$b = 1:10000
> object.size(e)
28 bytes
> object_size(e)
80.3 kB
> e$c = 1:10000
> object.size(e)
28 bytes
> object_size(e)
120 kB
See also Hadley's doc about memory in R: http://adv-r.had.co.nz/memory.html
Upvotes: 1