Open mjakubczak opened 3 weeks ago
I cannot reproduce this: when I execute the code, the object sizes stay constant. This is true across multiple systems and versions of R.
Here’s the output I get when running the exact same commands as you:
> box::use(./m1[foo])
> pryr::object_size(foo)
28.62 kB
> box::use(./m2[bar])
> pryr::object_size(foo)
28.62 kB
> pryr::object_size(bar)
50.69 kB
> box::use(./m3[baz])
> pryr::object_size(foo)
28.62 kB
> pryr::object_size(bar)
50.69 kB
> pryr::object_size(baz)
28.19 kB
@klmr Thank you for the quick answer. I've determined that renv could be involved in this issue - please check this repo for a minimal reprex: https://github.com/mjakubczak/boxtest/
tl;dr: with renv:
> pryr::object_size(foo)
203.02 kB
> pryr::object_size(bar)
203.02 kB
> pryr::object_size(baz)
203.02 kB
without renv:
> pryr::object_size(foo)
24.75 kB
> pryr::object_size(bar)
22.64 kB
> pryr::object_size(baz)
23.44 kB
Error description
Object size increases when importing multiple modules. This is really strange, because nothing happens to the object environment. In this example the size increases from 435kB to 26MB (!) just when loading 2nd module. Looks like all imported objects share the same resources, because finally all of them have the same accumulated size.
m1.R
m2.R
m3.R
console output
R version
‘box’ version
1.2.0