Closed
Bug 791263
Opened 12 years ago
Closed 12 years ago
[ARMv6] completely disable screenshot code (including memory allocation) on memory pressure
Categories
(Firefox for Android Graveyard :: Toolbar, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 18
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: [ARMv6])
Attachments
(1 file, 1 obsolete file)
9.02 KB,
patch
|
blassey
:
review+
|
Details | Diff | Splinter Review |
Right now if ScreenshotHandler.getInstance() is called even once it will allocate and hold on to a large memory buffer for screenshotting. It would be good to ensure that this buffer gets freed if screenshotting is disabled, and also to make screenshotting controlled by a pref rather than a hard-coded value.
Assignee | ||
Comment 1•12 years ago
|
||
I decided to just make it get disabled dynamically on low memory instead of adding a pref.
Attachment #661903 -
Flags: review?(blassey.bugs)
Comment 2•12 years ago
|
||
Comment on attachment 661903 [details] [diff] [review]
Disable screenshotting on low memory and free the buffer
Review of attachment 661903 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/GeckoApp.java
@@ +2130,5 @@
> {
> Log.e(LOGTAG, "low memory");
> if (checkLaunchState(LaunchState.GeckoRunning))
> GeckoAppShell.onLowMemory();
> + ScreenshotHandler.disableScreenshot();
should we turn it back on at some point? What if this low memory condition is temporary (heavy page, lots of tabs, sync happening, etc)?
Assignee | ||
Comment 3•12 years ago
|
||
Maybe. I wasn't really sure if we should because if it's a heavy page or lots of tabs then that might just be the usage pattern of the user. If that's the case we're likely to run into low-mem situations often and it's better to just leave it off.
If you want though I could try to add a check for memory usage when we close a tab, and if we have a bunch of free memory we can re-enable screenshotting.
Comment 4•12 years ago
|
||
I'm thinking that once we get into this "disable things to lower memory usage" we should set a timer to query the memory situation periodically and see if we can start turning things back on.
Assignee | ||
Comment 5•12 years ago
|
||
Comment on attachment 661903 [details] [diff] [review]
Disable screenshotting on low memory and free the buffer
Sounds reasonable. I'll cook up a patch with that.
Attachment #661903 -
Flags: review?(blassey.bugs)
Assignee | ||
Comment 6•12 years ago
|
||
This applies on top of the MemoryMonitor patch from bug 713032 which is on inbound now. I don't want to land this just yet, I'd rather get bug 792165 resolved first so hopefully we can measure the improvement this makes. Putting this patch here anyway as a working patch modulo future rebasing.
Attachment #661903 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #662687 -
Flags: review?(blassey.bugs)
Comment 7•12 years ago
|
||
Comment on attachment 662687 [details] [diff] [review]
Disable screenshotting on low memory and free the buffer (v2)
Review of attachment 662687 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/base/MemoryMonitor.java
@@ +149,5 @@
> }
>
> private synchronized boolean decreaseMemoryPressure() {
> + int newLevel;
> + synchronized (this) {
this is redundant, the method is synchronized, which is equivalent to synchronized (this) aiui
Attachment #662687 -
Flags: review?(blassey.bugs) → review+
Assignee | ||
Comment 8•12 years ago
|
||
(In reply to Brad Lassey [:blassey] from comment #7)
> > private synchronized boolean decreaseMemoryPressure() {
> > + int newLevel;
> > + synchronized (this) {
>
> this is redundant, the method is synchronized, which is equivalent to
> synchronized (this) aiui
Oh whoops, I meant to remove the synchronization on the method and just leave the smaller block synchronized. I don't want to run external code while holding on to the MemoryMonitor lock.
Assignee | ||
Comment 9•12 years ago
|
||
Landed with that synchronization taken out:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5898731aa944
Comment 10•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 18
Comment 11•12 years ago
|
||
changing summary to reflect what this patch did
No longer blocks: 797015
Summary: [ARMv6] Add a pref to completely disable screenshot code (including memory allocation) → [ARMv6] completely disable screenshot code (including memory allocation) on memory pressure
Updated•12 years ago
|
Whiteboard: [ARMv6]
Updated•4 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
•