Closed
Bug 1298161
Opened 8 years ago
Closed 8 years ago
android.os.StrictMode$InstanceCountViolation: class org.mozilla.gecko.BrowserApp
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox51 fixed)
RESOLVED
FIXED
Firefox 51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: jchen, Assigned: jchen)
Details
Attachments
(4 files)
12.40 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
4.45 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
2.13 KB,
patch
|
rbarker
:
review+
|
Details | Diff | Splinter Review |
10.83 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
When we recreate BrowserApp instances, previous instances are leaked as shown by InstanceCountViolation in the logcat, e.g.,
> android.os.StrictMode$InstanceCountViolation: class org.mozilla.gecko.BrowserApp; instances=nnn; limit=1
I looked through a memory profile and there were several sources of leaks.
Assignee | ||
Comment 1•8 years ago
|
||
Move registration of AccessibilityManager listeners to GeckoApplication, and change all Context references to the application context, so that GeckoAccessibility doesn't leak old BrowserApp instances as new BrowserApp instances are created.
Attachment #8785366 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 2•8 years ago
|
||
Unregister certain events in BrowserApp and GeckoApp to prevent BrowserApp from leaking. Also, properly unregister event listeners in PageActionLayout to prevent BrowserApp leaks, because PageActionLayout.onDestroy never got called before.
Attachment #8785367 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 3•8 years ago
|
||
Properly remove pref handler on destroy to prevent leaking BrowserApp.
Attachment #8785369 -
Flags: review?(rbarker)
Assignee | ||
Comment 4•8 years ago
|
||
Use application context for delayed callbacks to prevent leaking the BrowserApp instance. Also, use application context for accessing Distribution, to prevent leaking old BrowserApp instances, and to avoid using a destroyed Context. Finally, attach AudioFocusAgent to the application context instead of the BrowserApp context to avoid leaking BrowserApp.
Attachment #8785370 -
Flags: review?(s.kaspari)
Updated•8 years ago
|
Attachment #8785369 -
Flags: review?(rbarker) → review+
Updated•8 years ago
|
Attachment #8785366 -
Flags: review?(s.kaspari) → review+
Updated•8 years ago
|
Attachment #8785367 -
Flags: review?(s.kaspari) → review+
Updated•8 years ago
|
Attachment #8785370 -
Flags: review?(s.kaspari) → review+
Comment 5•8 years ago
|
||
Awesome!
Pushed by nchen@mozilla.com: https://hg.mozilla.org/integration/fx-team/rev/18a92c5e14e6 a. Fix BrowserApp leak in GeckoAccessibility; r=sebastian https://hg.mozilla.org/integration/fx-team/rev/2c6691bd8a71 b. Fix BrowserApp leaks in event registration; r=sebastian https://hg.mozilla.org/integration/fx-team/rev/322bce6bc1d6 c. Properly remove pref handler in NativePanZoomController; r=rbarker https://hg.mozilla.org/integration/fx-team/rev/803dba6b6691 d. Use application context to prevent BrowserApp leaks; r=sebastian
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/18a92c5e14e6 https://hg.mozilla.org/mozilla-central/rev/2c6691bd8a71 https://hg.mozilla.org/mozilla-central/rev/322bce6bc1d6 https://hg.mozilla.org/mozilla-central/rev/803dba6b6691
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•