[R] Problem with file size

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 14 08:24:31 CET 2006


On Mon, 13 Nov 2006, Benilton Carvalho wrote:

> Hi everyone,
>
> I have 2 environments (2 different R sessions) as described below:
>
> Session 1:
>
> Name of the environment: "CrlmmInfo"
> Objects in the environment:
>    index1: logical index - length 238304
>    index2: logical index - length 238304
>    priors: list of 4 - (matrix 6x6, 2 vectors of length 6, vector of
> length 2) - all num
>    params: list of 4:
>          centers [238304 x 3 x 2]: num
>          scales [238304 x 3 x 2]: num
>          N [238304 x 3]: num
>          f0 [scalar]: num
>
> If I save this environment to a file, I get a file of 23MB. Great.
>
> Session 2:
>     Analogous to "Session 1", but replace 238304 by 262264.
>
> If I save the environment on Session 2, I get a file of 8.4GB.
>
> I applied object.size on each of the objects in each environment, and
> this is what I got:
>
> For Session 1:
> index1: 16204864
> index2: 16204864
> priors: 3336
> params: 74353584
>
> For Session 2:
> index1: 1049096
> index2: 1049096
> priors: 3336
> params: 81829104
>
> Is this increase from 23MB to 8.4GB expected to happen?

We don't have enough information to expect anything.  Saving environments 
is a tricky business: read the description in the R Internals manual if 
this is news to you.

But note that the index[12] objects are much smaller in Session 2, and 
those in Session 1 are about 16x larger than needed for the description 
given.  So my guess is that they have attributes which are promises in 
Session 2, and save() there is pulling in another environment to enable 
those attributes to be evaluated later.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list