From murdoch at stats.uwo.ca  Sun Feb 17 02:05:06 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Sat, 16 Feb 2008 20:05:06 -0500
Subject: [Rd] forcing gc() to do its work
In-Reply-To: <22D850BC39A25742977325ADDE208E7702669562E6@chiexchange02.w2k.jumptrading.com>
References: <22D850BC39A25742977325ADDE208E7702669562E6@chiexchange02.w2k.jumptrading.com>
Message-ID: <47B78842.9050008@stats.uwo.ca>

On 16/02/2008 7:56 PM, Vadim Organovich wrote:
> Hi,
> 
> At some points of my computations I want gc() to try really hard and collect as many objects as possible even though the triggering limits are not hit. Will it help if I temporarily set the limits to some small values, call gc() and then reset them back to their original values? What variables exactly need to be set?  Does anyone have a prototype of such function?
> 
> I tried to read the R help, e.g. Memory and memory.limits(), but I am not sure I understand how this applies to my case.

See the R Internals manual, or the comments in memory.c.  Calling gc() 
makes it try as hard as it can (a level 2 collection).  You can't make 
it try harder.

Duncan Murdoch



[Rd] forcing gc() to do its work
Duncan Murdoch