1 Following are examples of running js_objgc.d.
3 This script reports on the garbage collection of Java objects. That is it
4 will keep track of when resources are allocated to an object, and when
5 resources are freed from an object. It is useful for providing information on
6 when garbage collection is not working correctly, as this can cause the
7 browser to have a memory leak.
9 We trace object creation (+1) and destruction (-1), and provide a summary
10 each second of the running tally of the object class and originating filename.
12 Here we can see it running on Code/JavaScript/func_clock.html
15 Tracing... Hit Ctrl-C to end.
17 FILE TOTAL CLASS 2007 Sep 23 22:59:24
18 func_clock.html 1 Date
20 FILE TOTAL CLASS 2007 Sep 23 22:59:25
21 func_clock.html 2 Date
23 FILE TOTAL CLASS 2007 Sep 23 22:59:26
24 func_clock.html 3 Date
26 FILE TOTAL CLASS 2007 Sep 23 22:59:27
27 func_clock.html 4 Date
29 FILE TOTAL CLASS 2007 Sep 23 22:59:28
30 func_clock.html 5 Date
32 FILE TOTAL CLASS 2007 Sep 23 22:59:29
35 func_clock.html 6 Date
38 FILE TOTAL CLASS 2007 Sep 23 22:59:30
41 func_clock.html 7 Date
44 FILE TOTAL CLASS 2007 Sep 23 22:59:31
46 <null> 1 HTMLBodyElement
47 <null> 1 XPCNativeWrapper
48 <null> 1 XPC_WN_ModsAllowed_Proto_JSClass
50 browser.js 1 XPCNativeWrapper
52 func_clock.html 7 Date
55 browser.js 20 Function
57 FILE TOTAL CLASS 2007 Sep 23 22:59:32
60 <null> 1 HTMLBodyElement
63 <null> 1 XPCNativeWrapper
64 <null> 1 XPC_WN_ModsAllowed_Proto_JSClass
65 <null> 1 chrome://global/content/bindings/menu.xml#menu-iconic 84ff45a
66 <null> 1 chrome://global/content/bindings/menu.xml#menu-iconic 8befbba
67 bookmarksMenu.js 1 Function
69 browser.js 1 XPCNativeWrapper
71 scrollbox.xml 1 Function
75 firebug-service.js 3 Object
77 bookmarks.js 6 XPCWrappedNative_NoHelper
78 func_clock.html 8 Date
79 firebug-service.js 10 Function
82 browser.js 20 Function
83 bookmarks.js 22 Function
84 <null> 39 XPCWrappedNative_NoHelper
89 [... 39 seconds deleted ...]
91 FILE TOTAL CLASS 2007 Sep 23 23:00:10
92 <null> 1 HTMLBodyElement
93 <null> 1 HTMLCollection
95 <null> 1 XPCNativeWrapper
96 <null> 1 XPC_WN_NoMods_Proto_JSClass
97 <null> 1 XULTreeBuilder
98 <null> 1 chrome://global/content/bindings/menu.xml#menu-iconic 84ff45a
99 <null> 1 chrome://global/content/bindings/menu.xml#menu-iconic 8befbba
100 <null> 1 chrome://global/content/bindings/tree.xml#treebody 84caa3a
101 <null> 1 chrome://global/content/bindings/tree.xml#treebody 84e3a72
102 <null> 1 nsXPCComponents_Interfaces
103 <null> 1 nsXPCComponents_Results
104 bookmarksMenu.js 1 Function
106 browser.js 1 XPCNativeWrapper
107 browser.js 1 XPC_WN_NoMods_Proto_JSClass
108 nsUpdateService.js 1 XPC_WN_NoMods_Proto_JSClass
109 nsUpdateService.js 1 nsJSCID
111 scrollbar.xml 1 String
112 scrollbox.xml 1 Function
116 <null> 2 XPC_WN_ModsAllowed_Proto_JSClass
117 <null> 2 nsXPCComponents_Classes
120 utilityOverlay.js 2 nsJSCID
121 utilityOverlay.js 2 nsJSIID
124 nsUpdateService.js 3 Array
125 nsUpdateService.js 3 Object
126 nsUpdateService.js 3 With
127 utilityOverlay.js 3 Call
129 utilityOverlay.js 4 Function
130 nsUpdateService.js 7 nsJSIID
131 nsUpdateService.js 15 Function
132 bookmarks.js 22 Function
135 func_clock.html 42 Date
137 firebug-service.js 57 Object
138 bookmarks.js 73 Error
139 browser.js 78 Function
141 bookmarks.js 114 Object
142 bookmarks.js 114 XPCWrappedNative_NoHelper
143 <null> 157 MouseEvent
144 firebug-service.js 172 Function
145 <null> 307 XPCWrappedNative_NoHelper
148 <null> 876 XULElement
151 FILE TOTAL CLASS 2007 Sep 23 23:00:11
153 <missed> -34 Function
154 <missed> -4 MouseEvent
156 <missed> -1 HTMLBodyElement
157 <missed> -1 HTMLCollection
158 <missed> -1 XPCNativeWrapper
159 <missed> -1 XPC_WN_ModsAllowed_Proto_JSClass
161 <null> 0 HTMLBodyElement
162 <null> 0 HTMLCollection
166 <null> 0 XPC_WN_NoMods_Proto_JSClass
167 <null> 0 XULTreeBuilder
168 <null> 0 nsXPCComponents_Classes
169 <null> 0 nsXPCComponents_Interfaces
170 <null> 0 nsXPCComponents_Results
172 browser.js 0 XPCNativeWrapper
173 browser.js 0 XPC_WN_NoMods_Proto_JSClass
175 nsUpdateService.js 0 Array
176 nsUpdateService.js 0 Function
177 nsUpdateService.js 0 Object
178 nsUpdateService.js 0 With
179 nsUpdateService.js 0 XPC_WN_NoMods_Proto_JSClass
180 nsUpdateService.js 0 nsJSCID
181 nsUpdateService.js 0 nsJSIID
182 scrollbar.xml 0 String
185 utilityOverlay.js 0 Call
186 utilityOverlay.js 0 Function
187 utilityOverlay.js 0 nsJSCID
189 <null> 1 XPCNativeWrapper
190 <null> 1 chrome://global/content/bindings/menu.xml#menu-iconic 84ff45a
191 <null> 1 chrome://global/content/bindings/menu.xml#menu-iconic 8befbba
192 <null> 1 chrome://global/content/bindings/tree.xml#treebody 84caa3a
193 <null> 1 chrome://global/content/bindings/tree.xml#treebody 84e3a72
194 bookmarksMenu.js 1 Function
195 browser.xul 1 Function
196 func_clock.html 1 Date
198 scrollbox.xml 1 XULElement
199 scrollbox.xml 1 nsJSIID
201 <null> 2 XPC_WN_ModsAllowed_Proto_JSClass
203 scrollbox.xml 2 Function
205 utilityOverlay.js 2 nsJSIID
208 firebug-service.js 5 Object
211 bookmarks.js 9 XPCWrappedNative_NoHelper
212 <null> 10 XPCWrappedNative_NoHelper
213 bookmarks.js 10 Object
214 browser.js 10 Function
215 bookmarks.js 15 Function
216 firebug-service.js 16 Function
218 bookmarks.js 75 Error
220 <null> 315 XULElement
223 Just after time 23:00:10, garbage collection fired cleaning up many objects.
224 The final output shows a much reduced object count including a negative
225 count for objects created before this script was tracing.
227 If over the period of several minutes an object type is still steadily
228 increasing, then that would be of interest. Be patient, depending on the rate
229 of object creation it can take over ten minutes for garbage collect to kick in.