Closed Bug 727552 Opened 12 years ago Closed 12 years ago

Galaxytoolbar add-on creates zombie compartments

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kmag, Unassigned)

References

Details

(Whiteboard: [MemShrink])

The Galaxytoolbar add-on[1] creates zombie compartments for the web pages it interacts with. As far as I can tell, zombie compartments replace previous zombie compartments rather than accumulating.


[1] https://addons.mozilla.org/addon/galaxytoolbar/
CCing developer.
Yes, thanks for finding that. I am on to fix it.
OK. Just to give some feedback for the moment.

I already found two issues which caused memory leaks in my extension:
- I always stored a reference to the last opened document handled by my extension in an object property of my AddOn
- I had some undeclared variables (no "var"),  assigned DOM Elements to them, and after my function was over, a compartment of the whole document stayed in Firefox Memory. Seems as if I polluted global namespace and so the GC was not able to recognize that the document reference could be cleaned from memory.

The second issue was quite hard to find, and I need to investigate further, if something like this is in other parts of my AddOn
(In reply to Jan from comment #3)
> OK. Just to give some feedback for the moment.
> 
> I already found two issues which caused memory leaks in my extension:
> - I always stored a reference to the last opened document handled by my
> extension in an object property of my AddOn
> - I had some undeclared variables (no "var"),  assigned DOM Elements to
> them, and after my function was over, a compartment of the whole document
> stayed in Firefox Memory. Seems as if I polluted global namespace and so the
> GC was not able to recognize that the document reference could be cleaned
> from memory.
> 
> The second issue was quite hard to find, and I need to investigate further,
> if something like this is in other parts of my AddOn

Use "use strict;"!  https://developer.mozilla.org/en/JavaScript/Strict_mode
Ok, I uploaded a new version to AMO (v2.6.12). This version should fix zombie compartments and another leak, which I found while testing. (sqlite-dbconnection wasn't closed properly in the options window when there were asynch operations waiting)
Thanks for the quick fix.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.