From: Michael Davis Date: 2001-06-09T22:48:50+09:00 Subject: [ruby-talk:16354] Garbage Collection? Here is a test script that is similar to what my btree is doing. The method test() eats memory like crazy. What can I do to get this method to stop eating memory? Thanks for any suggestions. def test() #GC.enable a = [] 0.upto(99999) {|i| a[i] = rand(999999)} b = Marshal.dump(a) #c = Marshal.load(b) c = nil b = nil 0.upto(a.nitems-1){|i| a[i] = nil} a = nil GC.start #print "GC.start\n" end def testing(count) 0.upto(count){|i| test} end GC.enable testing(200000)