Created
March 18, 2013 12:17
-
-
Save authorNari/5186776 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
| % cat /tmp/a.rb | |
| base_length = GC.stat[:heap_length] | |
| (base_length * 10000).times{ 'a' } | |
| GC.start | |
| if GC.stat[:heap_length] == base_length | |
| p heap_length: GC.stat[:heap_length], base_length: base_length | |
| p 'success' | |
| exit 0 | |
| else | |
| p heap_length: GC.stat[:heap_length], base_length: base_length | |
| p 'error' | |
| exit 1 | |
| end | |
| -- GC.stat導入後 | |
| % ./miniruby --disable-gem -v /tmp/a.rb | |
| ruby 2.0.0dev (2012-11-29 trunk 38120) [x86_64-linux] | |
| {:heap_length=>446, :base_length=>24} | |
| "error" | |
| -- GC.stat導入前 | |
| % ./miniruby --disable-gem -v /tmp/a.rb | |
| ruby 2.0.0dev (2012-11-29 trunk 38120) [x86_64-linux] | |
| {:heap_length=>24, :base_length=>24} | |
| "success" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment