Last active
February 19, 2019 02:37
-
-
Save mustmodify/29ea901474a8388c3cf698020c742df6 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
require 'allocation_stats' | |
stats = AllocationStats.trace { x = 'stuff'; String.new(x) } | |
puts stats.allocations(alias_paths: true).to_text | |
puts | |
stats2 = AllocationStats.trace { String.new("stuff")} | |
puts stats2.allocations(alias_paths: true).to_text | |
puts | |
stats3 = AllocationStats.trace { x = "stuff" } | |
puts stats3.allocations(alias_paths: true).to_text |
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
jw@logopolis:/projects/saw/castle$ ruby object_check.rb | |
sourcefile sourceline class_path method_id memsize class | |
--------------- ---------- ---------- --------- ------- ------ | |
object_check.rb 3 Class new 40 String | |
object_check.rb 3 40 String | |
sourcefile sourceline class_path method_id memsize class | |
--------------- ---------- ---------- --------- ------- ------ | |
object_check.rb 6 Class new 40 String | |
object_check.rb 6 40 String | |
sourcefile sourceline class_path method_id memsize class | |
--------------- ---------- ---------- --------- ------- ------ | |
object_check.rb 9 40 String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment