[R] Is there a way to detect when gc() is called?

Thomas Lumley tlumley at u.washington.edu
Mon Nov 12 19:33:29 CET 2001

On Mon, 12 Nov 2001, Henrik Bengtsson wrote:

> A finalizer feature is really great. However, currently this is actually
> more than I need. I only need to know when the garbage collector is started,
> not what object it is removing. In other words, I would like to have
> function myGC(...) called *automatically* when the memory is running low,
> almost like a onLowMemory="myGC()".

For that I think you'd have to hack into the garbage collector code


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