> |I'm using a lot of Tempfile's and I have been made aware that they
> |consume a lot of memory.
> 
> Tempfile allocates far lot more objects internally than plain File
> objects.  If you allow garbage collection for these tempfile objects,
> its consumption stays moderate. Can you remove "temps" variable from
> your example?

No, I need to hang on to them for a while. All in all I may easily
need a thousand tempfiles or more, but they wont all be open at the
same time. I don't understand why the Tempfile's need to be so
expensive to keep around if I close them when I'm not using them.

Cheers,

Thomas