Created
July 4, 2009 17:42
-
-
Save methodmissing/140648 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =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