summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/dtracetoolkit/Examples/rb_malloc_example.txt
blob: e0917c9af7ccbfca699baf953455ce3795698aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
The following is an example of rb_malloc.d.

WARNING: This script is not 100% accurate; This prints graphical
representations of libc malloc() byte distributions by "recent" Ruby operation, 
which we hope will be usually correct. This is an experimental script that may
be improved over time.

Here we can see it running on Code/Ruby/func_abc.rb

# rb_malloc.d -c ./func_abc.rb
Tracing... Hit Ctrl-C to end.
Function A
Function B
Function C
Ruby malloc byte distributions by recent Ruby operation,
   func_abc.rb, method, Object::print 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |@@@@@@@@@@@@@@@@@@@@                     1        
               4 |                                         0        
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@                     1        
              32 |                                         0        

   func_abc.rb, method, Module::method_added 
           value  ------------- Distribution ------------- count    
               8 |                                         0        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2        
              32 |                                         0        

   ., objnew, fatal 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |@                                        1        
               4 |@                                        1        
               8 |@@@                                      2        
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@             22       
              32 |@@@@@@                                   5        
              64 |                                         0        

   func_abc.rb, method, IO::write 
           value  ------------- Distribution ------------- count    
            2048 |                                         0        
            4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1        
            8192 |                                         0        

   ., objnew, SystemStackError 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |                                         3        
               4 |@@@@                                     32       
               8 |@@                                       15       
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@          279      
              32 |@@@                                      30       
              64 |                                         2        
             128 |                                         0        

   ., objnew, NoMemoryError 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |@                                        3        
               4 |@@@                                      17       
               8 |@@@@@@                                   37       
              16 |@@@@@@@@@@@@@@@@@@@@@@@@                 146      
              32 |@@                                       13       
              64 |                                         2        
             128 |@@@                                      20       
             256 |                                         0        
             512 |                                         0        
            1024 |                                         1        
            2048 |                                         0        

   ., objnew, ThreadGroup 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |                                         8        
               4 |@@@                                      224      
               8 |@                                        93       
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@              1806     
              32 |@@@@@@@@                                 496      
              64 |                                         3        
             128 |                                         2        
             256 |                                         0        
             512 |                                         1        
            1024 |                                         0        

   ., objnew, Object 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |                                         35       
               4 |@@@                                      291      
               8 |@@@                                      300      
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@           2679     
              32 |@@                                       215      
              64 |                                         7        
             128 |                                         0        

   ruby, startup, - 
           value  ------------- Distribution ------------- count    
               1 |                                         0        
               2 |@                                        10       
               4 |@@@                                      34       
               8 |@@@                                      38       
              16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@          409      
              32 |@@                                       30       
              64 |                                         1        
             128 |                                         0        
             256 |                                         0        
             512 |                                         0        
            1024 |                                         2        
            2048 |                                         0        
            4096 |                                         0        
            8192 |                                         0        
           16384 |                                         0        
           32768 |                                         0        
           65536 |                                         0        
          131072 |                                         1        
          262144 |                                         0        


OpenPOWER on IntegriCloud