The default bug view has changed. See this FAQ.

Galaxytoolbar add-on creates zombie compartments

RESOLVED FIXED

Status

()

Core
General
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: kmag, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

(Reporter)

Description

5 years ago
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/
(Reporter)

Comment 1

5 years ago
CCing developer.

Comment 2

5 years ago
Yes, thanks for finding that. I am on to fix it.

Comment 3

5 years ago
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

Comment 5

5 years ago
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)
(Reporter)

Comment 6

5 years ago
Thanks for the quick fix.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.