Created
March 23, 2009 08:32
-
-
Save jeremy/83469 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
#!/usr/bin/env ruby | |
class FooArray < Array; end | |
a = FooArray.new(1000000){'a'} | |
a = nil | |
GC.start | |
count = ObjectSpace.each_object(FooArray) {} | |
puts "#{count} objects remain after garbage collection" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment