Skip to content

Instantly share code, notes, and snippets.

@balinterdi
Created November 1, 2010 09:49
Show Gist options
  • Save balinterdi/657909 to your computer and use it in GitHub Desktop.
Save balinterdi/657909 to your computer and use it in GitHub Desktop.
# require 'memprof'
class Dumb
@@big_dumb_array = []
def initialize
@@big_dumb_array << [0] * 100_000
end
end
if __FILE__ == $0
# watch with top (or something similar) as the ruby process
# eats all of your memory...
while true
dumb = Dumb.new
dumb = nil
GC.start
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment