[R] how to free memory? (gc() doesn't work for me)

jim holtman jholtman at gmail.com
Sat Sep 4 13:50:14 CEST 2010


Seems to work for me:

> x <- matrix(0,10000,10000)
> object.size(x)
800000112 bytes
> gc()
            used  (Mb) gc trigger  (Mb)  max used  (Mb)
Ncells    174104   4.7     741108  19.8    741108  19.8
Vcells 101761938 776.4  113632405 867.0 102762450 784.1
> rm(x)
> gc()
          used (Mb) gc trigger  (Mb)  max used  (Mb)
Ncells  174202  4.7     741108  19.8    741108  19.8
Vcells 1761954 13.5   90905923 693.6 102762450 784.1


On Sat, Sep 4, 2010 at 12:46 AM, Hyunchul Kim
<hyunchul.kim.sfc at gmail.com> wrote:
> Hi, all
>
> I have a huge object that use almost all of available memory.
>
> R> rm(a_huge_object)
> R> gc()
>
> doesn't free memory and ?gc doesn't show anything.
>
> Are there any suggestion?
>
> Thanks in advance,
>
> Regards,
>
> Hyunchul
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list