il 24 Mar 2004 01:34:19 -0800, thomass / deltadata.dk (Thomas) ha
scritto::

>> |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.

probably bevcause:

close(unlink_now=false)

Closes the file. If the optional flag is true, unlinks the file after
closing.

If you don?t explicitly unlink the temporary file, the removal will be
delayed until the object is finalized. 

you have references to tempfile so it will nevere be finalized. Maybe
you could use close!