Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created July 4, 2009 17:42
Show Gist options
  • Select an option

  • Save methodmissing/140648 to your computer and use it in GitHub Desktop.

Select an option

Save methodmissing/140648 to your computer and use it in GitHub Desktop.
=begin
macbook-pros-computer:~ lourens$ ruby gc.rb
Collected 1112060
Collected 1112130
Collected 1112200
Collected 1112270
Collected 1112340
=end
include ObjectSpace
5.times do |i|
a = String(i)
define_finalizer(a, proc {|id| puts "Collected #{id}" })
end
GC.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment