Closed
Bug 392542
Opened 17 years ago
Closed 17 years ago
leak nsXULPDGlobalObject starting up and quitting Firefox on Mac (RLk nonzero)
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Keywords: memory-leak)
Attachments
(2 files)
3.06 KB,
text/plain; charset=us-ascii
|
Details | |
1.77 KB,
patch
|
enndeakin
:
review+
bzbarsky
:
superreview+
roc
:
approval1.9+
|
Details | Diff | Splinter Review |
Starting and shutting down firefox on Mac, we leak an nsXULPDGlobalObject. So far I've found that it's due to unbalanced js_LockGCThing calls due to multiple calls to nsXULPrototypeCache::PutScript. I see the following assertion fire once for each unbalanced js_LockGCThing (and it would cause an unbalanced js_LockGCThing due to the extra HoldScriptObject in that function):
NS_ASSERTION(!mScriptTable.Get(aURI, nsnull), "already have script in table");
Note that we're creating two scripts for the URI, and the first one put in the prototype cache is overwritten in the cache and thus leaked.
Assignee | ||
Comment 1•17 years ago
|
||
Er, I should have been clearer that I added that assertion at the start of nsXULPrototypeCache::PutScript.
Assignee | ||
Comment 2•17 years ago
|
||
Assignee | ||
Comment 3•17 years ago
|
||
The problem seems to be that two different nsXULDocument objects are loading (and blocking on) the same sequence 5 scripts at the same time. Not surprisingly, one of them is chrome://browser/content/hiddenWindow.xul and the other is chrome://browser/content/browser.xul .
Assignee | ||
Comment 4•17 years ago
|
||
It seems like what we should really be doing here is keeping a table of loading scripts in the XUL prototype cache, and adding additional listeners to existing loads. (I think we'd then need to have one of the listeners compile the script and put it in the cache and the rest get a different notification.)
And we should add the assertion above...
Assignee: dbaron → nobody
Assignee | ||
Comment 5•17 years ago
|
||
Then again, maybe I should just do the simple leak fix now and worry about the rest later.
Assignee: nobody → dbaron
Comment 6•17 years ago
|
||
Note, by the way, that we have a similar issue with overlays. They're placed in the cache much later than NewChannel(), so two NewChannel()s for the same overlay in quick succession will both try to start overlay loads, then in nsXULDocument::StartDocumentLoad we'll find the overlay in the cache and create a CachedChromeStreamListener which will assert in OnDataAvailable...
I don't think we clobber the cache in that case, though.
What I'd do here is do the simple leak fix, and a followup bug on adding the assert and making this code coalesce better.
Assignee | ||
Comment 7•17 years ago
|
||
Here's the obvious leak fix; I filed bug 392650 on the underlying problem, which is a bit more work.
Attachment #277141 -
Flags: superreview?(bzbarsky)
Attachment #277141 -
Flags: review?(enndeakin)
Comment 8•17 years ago
|
||
Comment on attachment 277141 [details] [diff] [review]
simple leak fix
Looks reasonable.
Attachment #277141 -
Flags: superreview?(bzbarsky) → superreview+
Updated•17 years ago
|
Attachment #277141 -
Flags: review?(enndeakin) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #277141 -
Flags: approval1.9?
Attachment #277141 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 9•17 years ago
|
||
Fix checked in to trunk.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M8
Assignee | ||
Comment 10•17 years ago
|
||
Hrm. On tinderbox, all this fixed was:
--FIXED-LEAKS---------------------------------leaks------leaks%
nsSystemPrincipal 0 -100.00%
nsXULPDGlobalObject 0 -100.00%
whereas on my machine it had fixed a good bit more (although I was just starting up and shutting down; not running the page cycler). So there's still more investigation needed for the leaks on tinderbox.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•