From rpeng at jhsph.edu  Thu Mar 24 19:14:20 2005
From: rpeng at jhsph.edu (Roger D. Peng)
Date: Thu Mar 24 19:14:29 2005
Subject: [Rd] saving errors/warnings (conditions)
Message-ID: <4243037C.60702@jhsph.edu>

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
-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/


[Rd] saving errors/warnings (conditions)
Roger D. Peng