Hi,

In message "Tempfile consuming a lot of memory"
    on 04/03/24, Thomas <thomass / deltadata.dk> writes:

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

|require 'tempfile'
|
|temps = []
|100.times {
|  |i|
|  t = Tempfile.new("blah#{i}.txt", ".")
|  #t = File.new("blah#{i}.txt", "w")
|  t.puts "hello world"
|  t.close
>  temps << t  # < this line
|}

							matz.