That took the total memory usage of R down to 627MB.
But then reading these things through system utilities isn't
ideal. R reports this:
> gc(TRUE)
Garbage collection 153 = 62+11+80 (level 2) ...
27.1 Mbytes of cons cells used (16%)
306.9 Mbytes of vectors used (49%)
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 506386 27.1 3170326 169.4 4953636 264.6
Vcells 40225372 306.9 82274108 627.8 76757609 585.7
(That's after the extract().) If I set the extracted
value to 0 and then gc again, I get back to 595MB in
the Activity Monitor and R reports this:
> gc(TRUE)
Garbage collection 155 = 62+11+82 (level 2) ...
27.1 Mbytes of cons cells used (25%)
272.0 Mbytes of vectors used (43%)
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 506345 27.1 2029008 108.4 4953636 264.6
Vcells 35643354 272.0 82274108 627.8 76757609 585.7
Basically the same numbers. So either extract() isn't using
any extra memory (very cool) or R's doing something unexpected
for GC (not out of the realm of possibility).
- Bob