Skip to content
Prev 15548 / 63424 Next

saving errors/warnings (conditions)

I recently ran a script which fit many different models (thousands, 
say) via glm(), some of which were successful and some not.  For the 
unsuccessful fits, I caught them using tryCatch() and returned either 
a "simpleError" object or a "simpleWarning" object, depending on 
whether it was an error or a warning that triggered the tryCatch.

I stored all the results in a single big list and I was surprised to 
see that the memory usage was nearly a 1 GB, but calling object.size() 
on the results list only returned about 5 MB (I only store two numbers 
from each fitted model object).  When I saved the results list the 
compressed workspace file was ~90MB.

The only thing I'd done differently from previous runs is store the 
error/warning objects.  Is there some environment that is being saved 
with a simpleError/Warning object that could be taking up all the 
memory?  I couldn't find any indication on the help page for tryCatch().

Thanks,

-roger