From: Michael Davis Date: 2001-06-10T00:03:56+09:00 Subject: [ruby-talk:16360] Garbage Collection? I have narrowed the issue down a little further. It appears to be related to Marshal.dump() and/or the << method, the += method does not eat memory. I wonder if it could be an issue with realloc not interacting properly with garbage collection. Any suggestions? def test_dump(count) a = [] 0.upto(99999) {|i| a[i] = rand(999999)} 0.upto(count) do |i| 0.upto(99) do |i| b = Marshal.dump(a) end b = nil GC.start print "GC.start\n" end 0.upto(a.nitems-1){|i| a[i] = nil} a = nil end def test_str_cat(count) a = '' 0.upto(count) do |i| 0.upto(99999) do |i| a << 'aaaa' end a = nil a = '' GC.start #print "GC.start\n" end 0.upto(a.nitems-1){|i| a[i] = nil} a = nil end #test_dump(200000) test_str_cat(200000)