tryleak.rb 276 B

123456789101112131415161718192021222324
  1. def on_update
  2. puts "hello"
  3. end
  4. index = 0
  5. memuser = "*"
  6. while index < 1000000
  7. on_update
  8. begin
  9. @foo = 10
  10. rescue Exception => ex
  11. p ex
  12. end
  13. memuser = memuser + memuser
  14. if (memuser.length > 1000)
  15. memuser = ""
  16. GC.start
  17. end
  18. index += 1
  19. end