[R] Memory warning (Reached total allocation of ...) - but no error

atan atanzap at gmail.com
Tue Jun 12 16:53:05 CEST 2012


Hi all

I have searched for a solution to the following problem and even tried
emailing the original poster, but have not had any luck in finding an
answer. 


Magnus Torfason-2 wrote
> 
> I'm getting the following warnings inside a loop:
> 
> Warning messages:
> 1: In calc.measures(g, 1, i) :
>    Reached total allocation of 1535Mb: see help(memory.size)
> 2: In calc.measures(g, 1, i) :
>    Reached total allocation of 1535Mb: see help(memory.size)
> 
> Usually, when I see these warnings, they are accompanied with an error
> message (Error: cannot allocate ...), but not in this case. I'm wondering
> how to react. 
> ...
> So I'm thinking that maybe the warnings are simply telling me that
> calc.measures allocated so many temporary variables that garbage
> collection had to be triggered. But then I get a nagging feeling - why is
> R warning me that GC had to be triggered - isn't that the whole point of
> GC, that it gets triggered when memory is running out?
> 
> I'd be grateful for advise on this: Should I just ignore these warnings as
> long as there are no errors, should I bite the bullet and call gc()
> manually, or is there a third way to deal with this?
> 

I am in fact receiving a series of identical warnings inside a big function
that I am running using Rx64 2.14.1 in Windows 7.  The function runs to
completion, and doesn't seem to be affected by the warnings.  However, I am
also weary as to why R is warning me about reaching my total memory
allocation without throwing up an error and stopping the function, which has
always happened in the past...  Garbage collection is not a solution here as
disused objects are cleared from memory before the evaluation within the
function occurs at which the memory limit is likely being hit.

Can anyone please offer an explanation as to why a warning would be reached
but not an error?  Even if the memory ceiling is hit during an internal
evaluation or object assignment that the rest of the function does not
"require" to run to completion, wouldn't an error still be called?

Many thanks,
Andrew

--
View this message in context: http://r.789695.n4.nabble.com/Memory-warning-Reached-total-allocation-of-but-no-error-tp2131226p4633110.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list