- what are the attributes of this object?
- in which document it lives?
- in which script it has been allocated?
- in which line?
- in which function?
- what is the function name/source?
The result of this is:
- a jsctypes C++ mangling library,
- a work-in-progress addon to identify DOM node leaks involving multiple compartments/documents, and,
- two (1, 2) bug fixes.
You can install this addon, it should work on Windows and Linux with FF20+. You can easily see bug 839280’s leaks on today’s Aurora (FF21) by opening firefox with this addon, then open and close the devtool inspector panel (CTRL+MAJ+I) and finally run the memory script by pressing ALT+SHIFT+D shortcut. Wait a bit, the addon is processing the whole CC graph and will freeze your firefox instance. And then open a folder with a log file that displays various information about potential cross compartment leaks.
Let me show you addon’s output for this leak. The code involved in this leak is the following button’s click listener: /browser/devtools/shared/DeveloperToolbar.jsm
1 2 3 4 5 6 7 8 9 10 11
The script will print this in the log file:
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
It immediatly tells you that you may leak something via this anonymous function. may leak, and not do leak, as it is always hard to tell which references are expected to be removed or not, but at least, it tells you that this reference still exist and may keep your compartment/document/global alive.