1 The following is an example of rb_malloc.d.
3 WARNING: This script is not 100% accurate; This prints graphical
4 representations of libc malloc() byte distributions by "recent" Ruby operation,
5 which we hope will be usually correct. This is an experimental script that may
8 Here we can see it running on Code/Ruby/func_abc.rb
10 # rb_malloc.d -c ./func_abc.rb
11 Tracing... Hit Ctrl-C to end.
15 Ruby malloc byte distributions by recent Ruby operation,
16 func_abc.rb, method, Object::print
17 value ------------- Distribution ------------- count
19 2 |@@@@@@@@@@@@@@@@@@@@ 1
22 16 |@@@@@@@@@@@@@@@@@@@@ 1
25 func_abc.rb, method, Module::method_added
26 value ------------- Distribution ------------- count
28 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
32 value ------------- Distribution ------------- count
37 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 22
41 func_abc.rb, method, IO::write
42 value ------------- Distribution ------------- count
44 4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
47 ., objnew, SystemStackError
48 value ------------- Distribution ------------- count
53 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 279
58 ., objnew, NoMemoryError
59 value ------------- Distribution ------------- count
64 16 |@@@@@@@@@@@@@@@@@@@@@@@@ 146
73 ., objnew, ThreadGroup
74 value ------------- Distribution ------------- count
79 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1806
88 value ------------- Distribution ------------- count
93 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2679
99 value ------------- Distribution ------------- count
104 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 409