Closed
Bug 652530
Opened 14 years ago
Closed 14 years ago
Memory leak when updating widget's content
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: peregrino, Assigned: ochameau)
Details
Attachments
(3 files)
When trying to update the content of an already existent widget, it seems that the previous content is leaked.
I attach a testcase that creates a widget and updates its content 1000 times, and the leak can be appreciated. With another testcase I could get Firefox to 1Gb RAM by updating a widget about 4000 times.
The workaround I found is to update the content by passing a message to the widget and listening to it on the contentScript.
Updated•14 years ago
|
Priority: -- → P1
Target Milestone: --- → 1.0
Comment 1•14 years ago
|
||
Alex: can you take a look at this?
Assignee | ||
Comment 2•14 years ago
|
||
Nice catch Hernán!
Here is this leak in details using this unit test:
With 200 instances
before: 45231876
after : 49095036
Assignee: nobody → poirot.alex
Assignee | ||
Comment 3•14 years ago
|
||
And now, with this patch, we have:
before: 45426972
after : 44792644
(memory used before and after changing 200 times widget.content attribute)
This leak was due to document-element-inserted/DOMContentLoaded/load listeners not unregistered when you change Symbiont contentURL *and* because we do not destroy the Symbiont before creating a new one in Widget.setContent.
Attachment #531726 -
Flags: review?(rFobic)
Comment 4•14 years ago
|
||
Comment on attachment 531726 [details] [diff] [review]
Fix this leak.
Review of attachment 531726 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks Alex.
Attachment #531726 -
Flags: review?(rFobic) → review+
Assignee | ||
Comment 5•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•