summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/dtracetoolkit/Examples/js_objgc_example.txt
blob: 711b223d08e6352b47c902e24c1b1b26d4623bbd (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
Following are examples of running js_objgc.d.

This script reports on the garbage collection of Java objects.  That is it
will keep track of when resources are allocated to an object, and when
resources are freed from an object.  It is useful for providing information on
when garbage collection is not working correctly, as this can cause the
browser to have a memory leak.

We trace object creation (+1) and destruction (-1), and provide a summary
each second of the running tally of the object class and originating filename. 

Here we can see it running on Code/JavaScript/func_clock.html

# js_objgc.d
Tracing... Hit Ctrl-C to end.

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:24
 func_clock.html                 1 Date

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:25
 func_clock.html                 2 Date

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:26
 func_clock.html                 3 Date

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:27
 func_clock.html                 4 Date

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:28
 func_clock.html                 5 Date

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:29
 browser.js                      3 Function
 <null>                          5 Function
 func_clock.html                 6 Date
 <null>                          7 MouseEvent

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:30
 browser.js                      3 Function
 <null>                          5 Function
 func_clock.html                 7 Date
 <null>                         10 MouseEvent

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:31
 <null>                          1 Constructor
 <null>                          1 HTMLBodyElement
 <null>                          1 XPCNativeWrapper
 <null>                          1 XPC_WN_ModsAllowed_Proto_JSClass
 browser.js                      1 Array
 browser.js                      1 XPCNativeWrapper
 popup.xml                       1 Array
 func_clock.html                 7 Date
 <null>                         13 MouseEvent
 <null>                         18 Function
 browser.js                     20 Function

 FILE                        TOTAL CLASS                   2007 Sep 23 22:59:32
 <null>                          1 BoxObject
 <null>                          1 Constructor
 <null>                          1 HTMLBodyElement
 <null>                          1 NodeList
 <null>                          1 UIEvent
 <null>                          1 XPCNativeWrapper
 <null>                          1 XPC_WN_ModsAllowed_Proto_JSClass
 <null>                          1 chrome://global/content/bindings/menu.xml#menu-iconic 84ff45a
 <null>                          1 chrome://global/content/bindings/menu.xml#menu-iconic 8befbba
 bookmarksMenu.js                1 Function
 browser.js                      1 Array
 browser.js                      1 XPCNativeWrapper
 popup.xml                       1 Function
 scrollbox.xml                   1 Function
 <null>                          2 Event
 popup.xml                       2 Array
 bookmarks.js                    3 With
 firebug-service.js              3 Object
 bookmarks.js                    6 Object
 bookmarks.js                    6 XPCWrappedNative_NoHelper
 func_clock.html                 8 Date
 firebug-service.js             10 Function
 <null>                         15 MouseEvent
 bookmarks.js                   19 Error
 browser.js                     20 Function
 bookmarks.js                   22 Function
 <null>                         39 XPCWrappedNative_NoHelper
 <null>                         44 Function
 <null>                         60 RegExp
 <null>                        191 XULElement

[... 39 seconds deleted ...]

 FILE                        TOTAL CLASS                   2007 Sep 23 23:00:10
 <null>                          1 HTMLBodyElement
 <null>                          1 HTMLCollection
 <null>                          1 TreeColumns
 <null>                          1 XPCNativeWrapper
 <null>                          1 XPC_WN_NoMods_Proto_JSClass
 <null>                          1 XULTreeBuilder
 <null>                          1 chrome://global/content/bindings/menu.xml#menu-iconic 84ff45a
 <null>                          1 chrome://global/content/bindings/menu.xml#menu-iconic 8befbba
 <null>                          1 chrome://global/content/bindings/tree.xml#treebody 84caa3a
 <null>                          1 chrome://global/content/bindings/tree.xml#treebody 84e3a72
 <null>                          1 nsXPCComponents_Interfaces
 <null>                          1 nsXPCComponents_Results
 bookmarksMenu.js                1 Function
 browser.js                      1 Array
 browser.js                      1 XPCNativeWrapper
 browser.js                      1 XPC_WN_NoMods_Proto_JSClass
 nsUpdateService.js              1 XPC_WN_NoMods_Proto_JSClass
 nsUpdateService.js              1 nsJSCID
 popup.xml                       1 Function
 scrollbar.xml                   1 String
 scrollbox.xml                   1 Function
 tree.xml                        1 Array
 <null>                          2 Constructor
 <null>                          2 UIEvent
 <null>                          2 XPC_WN_ModsAllowed_Proto_JSClass
 <null>                          2 nsXPCComponents_Classes
 browser.js                      2 nsJSCID
 browser.js                      2 nsJSIID
 utilityOverlay.js               2 nsJSCID
 utilityOverlay.js               2 nsJSIID
 <null>                          3 Array
 <null>                          3 NodeList
 nsUpdateService.js              3 Array
 nsUpdateService.js              3 Object
 nsUpdateService.js              3 With
 utilityOverlay.js               3 Call
 tree.xml                        4 Function
 utilityOverlay.js               4 Function
 nsUpdateService.js              7 nsJSIID
 nsUpdateService.js             15 Function
 bookmarks.js                   22 Function
 text.xml                       23 String
 <null>                         36 BoxObject
 func_clock.html                42 Date
 bookmarks.js                   57 With
 firebug-service.js             57 Object
 bookmarks.js                   73 Error
 browser.js                     78 Function
 popup.xml                      82 Array
 bookmarks.js                  114 Object
 bookmarks.js                  114 XPCWrappedNative_NoHelper
 <null>                        157 MouseEvent
 firebug-service.js            172 Function
 <null>                        307 XPCWrappedNative_NoHelper
 <null>                        388 RegExp
 <null>                        488 Event
 <null>                        876 XULElement
 <null>                       1221 Function

 FILE                        TOTAL CLASS                   2007 Sep 23 23:00:11
 <missed>                      -94 Date
 <missed>                      -34 Function
 <missed>                       -4 MouseEvent
 <missed>                       -2 Array
 <missed>                       -1 HTMLBodyElement
 <missed>                       -1 HTMLCollection
 <missed>                       -1 XPCNativeWrapper
 <missed>                       -1 XPC_WN_ModsAllowed_Proto_JSClass
 <null>                          0 Array
 <null>                          0 HTMLBodyElement
 <null>                          0 HTMLCollection
 <null>                          0 RegExp
 <null>                          0 TreeColumns
 <null>                          0 UIEvent
 <null>                          0 XPC_WN_NoMods_Proto_JSClass
 <null>                          0 XULTreeBuilder
 <null>                          0 nsXPCComponents_Classes
 <null>                          0 nsXPCComponents_Interfaces
 <null>                          0 nsXPCComponents_Results
 browser.js                      0 Array
 browser.js                      0 XPCNativeWrapper
 browser.js                      0 XPC_WN_NoMods_Proto_JSClass
 browser.js                      0 nsJSCID
 nsUpdateService.js              0 Array
 nsUpdateService.js              0 Function
 nsUpdateService.js              0 Object
 nsUpdateService.js              0 With
 nsUpdateService.js              0 XPC_WN_NoMods_Proto_JSClass
 nsUpdateService.js              0 nsJSCID
 nsUpdateService.js              0 nsJSIID
 scrollbar.xml                   0 String
 text.xml                        0 String
 tree.xml                        0 Array
 utilityOverlay.js               0 Call
 utilityOverlay.js               0 Function
 utilityOverlay.js               0 nsJSCID
 <null>                          1 NodeList
 <null>                          1 XPCNativeWrapper
 <null>                          1 chrome://global/content/bindings/menu.xml#menu-iconic 84ff45a
 <null>                          1 chrome://global/content/bindings/menu.xml#menu-iconic 8befbba
 <null>                          1 chrome://global/content/bindings/tree.xml#treebody 84caa3a
 <null>                          1 chrome://global/content/bindings/tree.xml#treebody 84e3a72
 bookmarksMenu.js                1 Function
 browser.xul                     1 Function
 func_clock.html                 1 Date
 popup.xml                       1 Function
 scrollbox.xml                   1 XULElement
 scrollbox.xml                   1 nsJSIID
 <null>                          2 Constructor
 <null>                          2 XPC_WN_ModsAllowed_Proto_JSClass
 browser.js                      2 nsJSIID
 scrollbox.xml                   2 Function
 tree.xml                        2 Function
 utilityOverlay.js               2 nsJSIID
 popup.xml                       3 Array
 bookmarks.js                    5 With
 firebug-service.js              5 Object
 <null>                          6 Event
 <null>                          6 MouseEvent
 bookmarks.js                    9 XPCWrappedNative_NoHelper
 <null>                         10 XPCWrappedNative_NoHelper
 bookmarks.js                   10 Object
 browser.js                     10 Function
 bookmarks.js                   15 Function
 firebug-service.js             16 Function
 <null>                         18 BoxObject
 bookmarks.js                   75 Error
 <null>                         79 Function
 <null>                        315 XULElement
^C

Just after time 23:00:10, garbage collection fired cleaning up many objects.
The final output shows a much reduced object count including a negative
count for objects created before this script was tracing.

If over the period of several minutes an object type is still steadily 
increasing, then that would be of interest.  Be patient, depending on the rate 
of object creation it can take over ten minutes for garbage collect to kick in.

OpenPOWER on IntegriCloud