[R] gc() shrinks with multiple iterations

Andrew Perrin aperrin at socrates.berkeley.edu
Tue Mar 13 03:39:10 CET 2001


Is it expected behavior for gc() to return shrinking values as it gets
called multiple times? Here's what I've got:

> gc()
          used (Mb) gc trigger  (Mb)
Ncells  221754  6.0     467875  12.5
Vcells 3760209 28.7   14880310 113.6
> gc()
          used (Mb) gc trigger (Mb)
Ncells  221760  6.0     467875 12.5
Vcells 3016206 23.1   11904247 90.9
> gc()
          used (Mb) gc trigger (Mb)
Ncells  221760  6.0     467875 12.5
Vcells 2420993 18.5    9523397 72.7
> gc()
          used (Mb) gc trigger (Mb)
Ncells  221760  6.0     467875 12.5
Vcells 1944823 14.9    7618717 58.2
> gc()
          used (Mb) gc trigger (Mb)
Ncells  221760    6     467875 12.5
Vcells 1563887   12    6094973 46.6
> gc()
          used (Mb) gc trigger (Mb)
Ncells  221760  6.0     467875 12.5
Vcells 1259138  9.7    4875978 37.3
> gc()
          used (Mb) gc trigger (Mb)
Ncells  221760  6.0     467875 12.5
Vcells 1015339  7.8    3900782 29.8
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 820300  6.3    3120625 23.9
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 664269  5.1    2496499 19.1
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 539443  4.2    1997199 15.3
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 439583  3.4    1597759 12.2
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 359695  2.8    1278207  9.8
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 295785  2.3    1022565  7.9
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells 244657  1.9     818051  6.3
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells  71762  0.6     786432  6.0
> gc()
         used (Mb) gc trigger (Mb)
Ncells 221760  6.0     467875 12.5
Vcells  40143  0.4     786432  6.0

It then stabilizes at those values. Any explanation?

----------------------------------------------------------------------
Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology  
(Soon: Asst Professor of Sociology, U of North Carolina, Chapel Hill)
andrew_perrin at unc.edu - http://www.unc.edu/~aperrin

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list