require 'gtk2' def mem IO.readlines('/proc/self/status').join =~ /(VmRSS.*?kB)/ puts $1 end puts "After startup:" mem puts puts "Repeated reassigns of about 12.5M with Array.new:" for i in 1 .. 20 a = Array.new(3125000) mem end puts "after GC.start:" GC.start mem puts puts "Repeated reassigns of about 12.5M with Gdk::Pixbuf.new:" for i in 1 .. 20 a = Gdk::Pixbuf.new('/tmp/pa.jpg') mem end puts "after GC.start:" GC.start mem puts