Closed
Bug 833796
Opened 12 years ago
Closed 12 years ago
B2G's forms.js leaks due to a shutdown observer
Categories
(Firefox OS Graveyard :: General, defect)
Firefox OS Graveyard
General
Tracking
(blocking-b2g:tef+, firefox21 fixed, b2g18 fixed, b2g18-v1.0.1 fixed)
People
(Reporter: justin.lebar+bug, Assigned: justin.lebar+bug)
References
Details
(Whiteboard: [MemShrink] QARegressExclude)
Attachments
(1 file)
1.59 KB,
patch
|
vingtetun
:
review+
m1
:
feedback+
|
Details | Diff | Splinter Review |
B2G's forms.js is loaded by Keyboard.jsm. The keyboard loads forms.js into each new mozbrowser, by hooking onto the observer messages 'in-process-browser-or-app-shown' and 'remote-browser-frame-shown'.
But if we're not careful, forms.js can cause leaks by adding strong refs to itself from the outside. Then, when its frame element goes away, the forms.js script stays alive, holding the frame element alive, and therefore holding alive all other frame scripts as well!
At the very least, I think forms.js is leaking via its use of the observer service:
> Services.obs.addObserver(this, "xpcom-shutdown", false);
|false| means this is a strong observer, which means that this object is not released until shutdown. So the code that's trying to help us avoid shutdown leaks is (at least partially) causing runtime leaks!
Assignee | ||
Comment 1•12 years ago
|
||
I'm going to see if I can reproduce bug 833077 locally, and if removing the observer service stuff from forms.js fixes the issue.
Assignee | ||
Updated•12 years ago
|
Whiteboard: [MemShrink]
Updated•12 years ago
|
Assignee: nobody → justin.lebar+bug
Assignee | ||
Comment 2•12 years ago
|
||
This shutdown observer is not doing any good, as far as I can tell. (If you really want to keep it, we can make it use a weak ref.)
Attachment #705349 -
Flags: review?(21)
Assignee | ||
Comment 3•12 years ago
|
||
This seems to fix bug 833077 for me on desktop B2G. mvines, would you mind testing on your device?
Assignee | ||
Updated•12 years ago
|
Attachment #705349 -
Flags: feedback?(mvines)
Comment 4•12 years ago
|
||
Comment on attachment 705349 [details] [diff] [review]
Patch, v1
Looks good! After 347 iterations Uss is holding around 10MB.
Attachment #705349 -
Flags: feedback?(mvines) → feedback+
Comment 5•12 years ago
|
||
Comment on attachment 705349 [details] [diff] [review]
Patch, v1
If this code fix the leak I'm all for it!
Attachment #705349 -
Flags: review?(21) → review+
Assignee | ||
Comment 6•12 years ago
|
||
Assignee | ||
Comment 7•12 years ago
|
||
checkin-needed for b2g18 (after this lands on m-c; I didn't push to try first). This can land without approval because it's a likely fix for bug 833077, which is tef+.
Keywords: checkin-needed
Comment 8•12 years ago
|
||
Could this leak also manifest in the main process? We're also debugging some unbounded memory growth that monkey is triggering, sometimes, there. Maybe we have a twofer here!
Assignee | ||
Comment 9•12 years ago
|
||
(In reply to Michael Vines [:m1] from comment #8)
> Could this leak also manifest in the main process? We're also debugging
> some unbounded memory growth that monkey is triggering, sometimes, there.
> Maybe we have a twofer here!
Yes, that's possible, if the app is running in the main process.
When I tested this on desktop B2G, everything was running in the main process, and this patch fixed the problem there.
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
(In reply to Ryan VanderMeulen from comment #10)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/06d0d20fbaf1
Wrong bug, sorry.
status-firefox21:
--- → fixed
Keywords: checkin-needed
Updated•12 years ago
|
Flags: in-testsuite+
Assignee | ||
Updated•12 years ago
|
Summary: B2G's forms.js leaks (I think...) → B2G's forms.js leaks due to a shutdown observer
Assignee | ||
Comment 12•12 years ago
|
||
status-b2g18:
--- → fixed
Keywords: checkin-needed
Nice find.
Comment 15•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 17•12 years ago
|
||
This is already in b2g18_v1_0_1, so I don't think there's any additional action required here.
It's very easy to tell if a bug is resolved on a branch using git. I did
$ git log origin/b2g18_v1_0_1 --grep 833796
If you're on the git.mozilla.org/releases/gecko.git repo, you'd probably do the same, but substitute "b2g18_v1_0_1" with "v1_0_1".
Assignee | ||
Updated•12 years ago
|
status-b2g18-v1.0.1:
--- → fixed
Assignee | ||
Comment 18•12 years ago
|
||
Since this landed before we branched b2g18 to b2g18_v1_0_1, the hg hash on 1.0.1 is the same as on b2g18:
https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/e9c3657e5cc6
You need to log in
before you can comment on or make changes to this bug.
Description
•