Skip to content

Instantly share code, notes, and snippets.

@craiglittle
Last active February 8, 2016 02:41
Show Gist options
  • Save craiglittle/7da6739fe480aca9ed3a to your computer and use it in GitHub Desktop.
Save craiglittle/7da6739fe480aca9ed3a to your computer and use it in GitHub Desktop.
Script to demonstrate finite_machine memory leak
require 'finite_machine'
2.times do
puts
ObjectSpace.garbage_collect
p ObjectSpace.count_objects
p ObjectSpace.count_objects.values.reduce(:+)
1_000.times do
FiniteMachine.define
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment