require 'gtk2' require 'booh/libadds' loads = 3 w = Gtk::Window.new w.show_all def get_mem IO.readlines('/proc/self/status').join =~ /VmRSS.*?(\d+)\s*kB/ puts "\VmRSS: #{$1}" end $stdout.sync = true get_mem images = Dir.entries('.').find_all { |f| f =~ /\.jpg/ } while true img = images.shift print "Loading #{loads} times #{img} [#{'.'*loads}]" + "\e[D" * (loads+1) for i in 1..loads Gtk.main_iteration while Gtk.events_pending? pixbuf = Gdk::Pixbuf.new(img) print "#" end puts get_mem puts "Starting GC..." GC.start get_mem end