Hello Thomas,

Wednesday, March 24, 2004, 4:14:29 PM, you wrote:

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

TS> I can understand that, but this fragment uses 320MB of memory, ie. about
TS> 300KB per closed Tempfile. That seems wildly unreasonable to me. With
TS> regular files the total size of the ruby process is 3.2MB!

TS> temps = []
TS> 1000.times {
TS>   |i|
TS>   t = Tempfile.new("blah#{i}.txt", ".")
TS>   t.puts "hello world"
TS>   t.close
TS>   temps << t
TS> }

TS> puts "Done"
TS> gets


TS> I use ruby 1.8.0 (pragprog build) on Windows XP.

Have you tried the same under Linux ?
Maybe this can give us a clue what is wrong.




-- 
Best regards,
 Lothar                            mailto:mailinglists / scriptolutions.com