Android idle battery drain due to Firefox
Categories
(Firefox for Android :: Performance, defect)
Tracking
()
Performance Impact | high |
People
(Reporter: ahmed.milkshake, Unassigned, NeedInfo)
References
(Blocks 2 open bugs)
Details
Attachments
(6 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0) Gecko/20100101 Firefox/124.0
Firefox for Android
Steps to reproduce:
I have Firefox (normal version, not beta) installed on my Pixel 7 running Android 14 (April 5 security update, but the issue started before this update). I noticed that my phone's battery has been poor since the last few weeks, especially when its idle during the night (when I'm asleep). Even if I use Firefox for some time, its battery usage is much higher than the usage of other apps although they have a greater screen time! (see pictures).
Actual results:
When checking battery usage, it shows that Firefox is consistently causing anywhere from 80% - 95% of the drain during that hour, while being in the background for less than a minute (see attached screenshots and how it compares to other apps like social media). I also don't keep the app in recent apps (I clear them before going to sleep), if that changes anything.
Expected results:
I didn't expect Firefox to use the amount of battery it's using especially compared to battery hungry apps such as Snapchat. See the third picture where Instagram is used for a much longer period of time compared to Firefox, but Firefox's battery usage is still higher. Is this behaviour normal?
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Fenix::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Attached are the results of our testing on a Google Pixel 7 Pro (Android 14) and Google Pixel 7 (Android 14). These devices were fully charged, had Firefox Nightly opened, and were left in sleep mode for 24 hours before we checked the battery usage.
Comment 3•1 year ago
|
||
Comment 4•1 year ago
|
||
I did also notice high reported battery consumption in the battery settings of Android, with Firefox alledgedly responsible for over half of the battery consumption while running only a handful of minutes. However I think it's a reporting problem rather than a battery problem :
- I installed a third party battery monitor program, and it doesn't report the same high consumption
- I left my device (Samsung Galaxy Tab S8) idle all day, with Firefox open or closed, and noted similar battery drain in both cases (about 3%), however Android seemed to think that Firefox was solely responsible for the battery drain in the second case. Moreover the third party battery monitor app confirmed the device was put in deep sleep the whole day in both cases.
At this point I have no idea why this happens, maybe Firefox registers background workers that stay idle all the time, but Android thinks they still use resources, but I'm no Android expert and I wouldn't know how to debug that.
I can run more thorough tests to determine the real impact of Firefox on battery drain while running for example, if need be.
Updated•1 year ago
|
Can this be set to a high priority? Many users are complaining about it:
https://old.reddit.com/r/firefox/search/?q=android+battery+&restrict_sr=on&t=month
Comment 7•1 year ago
|
||
The severity field is not set for this bug.
:kaya, could you have a look please?
For more information, please visit BugBot documentation.
I have checked the battery usage on my pixel 8 pro and it seems that 25% of thr battery usage was FF. In the middle of the night, wgen the phine should be in deep sleep mode.
The entire time it has drained 7% of my battery in an approximately 8 hour window. Normally it's only 2% without FF installed on my phone.
It seems in FF something blocks the phone to jump into a deep sleep mode and something is constantly running in the background. (Worker thread maybe? Update process? Javascript?)
Comment 9•1 year ago
|
||
Same here. Using regular Firefox 126.0.1 (Build #2016023311) on Android, not Beta, not Fennec.
See as well https://connect.mozilla.org/t5/discussions/firefox-for-android-v122-high-battery-usage/td-p/50056.
Unfortunately this is a showstopper for me as it drains my baterry in less than a day.
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Can confirm it happens on my S24 Ultra. Tried using different versions and keep happening.
Curious that even when enabling features to strict battery usage, it keeps draining my battery. Only solution it's really uninstalling Firefox.
Comment 11•1 year ago
|
||
Hello :ahmed.milkshake, :Elie Donadio, :pi3c3, :georg.sorst, :Ariano! Thank you so much for providing us your experiences with the app.
We are trying to scope down the reason for the issue you're experiencing so that I would like to know whether the Enable Firefox Suggest
toggle in the Secret Settings
is enabled for you or not. To check that out, you will need to follow the steps below:
1- Open the app that you're experiencing the issue on.
2- Navigate to the Settings
from the 3 dot menu on the app toolbar.
3- Scroll down to the bottom of the Settings
and click About Firefox
(or About Firefox Nightly
- depending on which app you're experiencing the issue).
4- Click to the Firefox icon 5 times which will enable the debug menu/secret settings for you. (You should see the toast message Debug menu enabled
once you perform 5 clicks!).
5- Go back to the Settings
via back button.
6- Scroll down to the bottom in the Settings
and check if you see the Secret Settings
(If you do not see the Secret Settings
, you will probably need to revisit the steps 3 and 4).
7- Click Secret Settings
and check if the "Enable Firefox Suggest"
toggle is enabled or not.
8- Please comment to this ticket whether the toggle was enabled for you or not.
Thanks a lot again!
Comment 12•1 year ago
|
||
:kaya I'm experiencing a similar battery drain, and I don't have Firefox Suggest enabled on my device.
I've made a comment about my experience and attached some screenshots in the meta bug thread a while ago (https://bugzilla.mozilla.org/show_bug.cgi?id=1889609), but I guess they'd be more suitable in here, as the metrics I've grabbed affect the idle drain. long story short, the detailed metrics on my phone's custom ROM show high "video" usage for Firefox, which I can only assume refers to GPU rendering.
Comment 13•1 year ago
|
||
(In reply to Kayacan Kaya [:kaya] from comment #11)
Hello :ahmed.milkshake, :Elie Donadio, :pi3c3, :georg.sorst, :Ariano! Thank you so much for providing us your experiences with the app.
We are trying to scope down the reason for the issue you're experiencing so that I would like to know whether the
Enable Firefox Suggest
toggle in theSecret Settings
is enabled for you or not. To check that out, you will need to follow the steps below:1- Open the app that you're experiencing the issue on.
2- Navigate to theSettings
from the 3 dot menu on the app toolbar.
3- Scroll down to the bottom of theSettings
and clickAbout Firefox
(orAbout Firefox Nightly
- depending on which app you're experiencing the issue).
4- Click to the Firefox icon 5 times which will enable the debug menu/secret settings for you. (You should see the toast messageDebug menu enabled
once you perform 5 clicks!).
5- Go back to theSettings
via back button.
6- Scroll down to the bottom in theSettings
and check if you see theSecret Settings
(If you do not see theSecret Settings
, you will probably need to revisit the steps 3 and 4).
7- ClickSecret Settings
and check if the"Enable Firefox Suggest"
toggle is enabled or not.
8- Please comment to this ticket whether the toggle was enabled for you or not.Thanks a lot again!
Firefox Suggest is not enabled for me.
Comment 14•1 year ago
|
||
Hello, I wanted to report a high background battery drain even when not using Firefox at all, and found this bug. In the past few weeks, my battery feels to deplete quicker, and according to battery stats on Android, it seems to be caused by Firefox.
When I wake up at 6 am, Firefox has already consumed 2.4% battery in those 6 hours between midnight and 6 AM. It seems to be happening in regular intervals (according to the battery graph) and it's happening despite the phone being in a power saver mode and with all network access disabled (wifi+mobile). In the evening at 10 PM (20 hours since the measurement started), Firefox has consumed 9.8% battery, despite not being used the whole day at all. [1] I'll attach screenshots for all these numbers with more detailed data (cpu time, wake ups, wake locks, net packets - all being extremely low), please review them.
None of this helps:
- Closing all tabs in Firefox.
- Closing the Firefox app (by swiping it off in the app switcher).
- Disabling all networks (wifi + mobile).
- Using a power saver battery mode.
- Configuring Firefox for deep sleep in system UI, which should prevent any background use.
- Disabling Firefox sync.
- Rebooting the phone.
During the day, whenever I check the battery summary screen (in some meaningful intervals, i.e. every 15 or 30 minutes), the Firefox drain percentage goes up by some percent fraction (i.e. by 0.1% or 0.2%, if I check often). Although the nightly graph would suggest hourly tasks, the drain seems to be happening more often or continuously.
Firefox Suggest is not enabled.
Firefox version: 126.0.1 from Google Play
Phone: Samsung Galaxy A33 5G with Android 14 and Samsung One UI 6.1
[1] The percentages might seem small, but the total battery drain is always at least a double of all the summed up percentages from all apps. Not sure how the system counts it, but for comparison, 45 minutes of reading web in Chrome shows up as 3.8%, while not using Firefox as all shows up as 9.8%, which seems pretty bad.
Comment 15•1 year ago
|
||
battery stats in the morning
Comment 16•1 year ago
|
||
battery stats in the morning - details
Comment 17•1 year ago
|
||
battery stats in the evening, after 20 hours of not using Firefox at all
Comment 18•1 year ago
|
||
battery stats in the evening, after 20 hours of not using Firefox at all - details
Comment 19•1 year ago
|
||
(In reply to Kayacan Kaya [:kaya] from comment #11)
Hello :ahmed.milkshake, :Elie Donadio, :pi3c3, :georg.sorst, :Ariano! Thank you so much for providing us your experiences with the app.
We are trying to scope down the reason for the issue you're experiencing so that I would like to know whether the
Enable Firefox Suggest
toggle in theSecret Settings
is enabled for you or not. To check that out, you will need to follow the steps below:1- Open the app that you're experiencing the issue on.
2- Navigate to theSettings
from the 3 dot menu on the app toolbar.
3- Scroll down to the bottom of theSettings
and clickAbout Firefox
(orAbout Firefox Nightly
- depending on which app you're experiencing the issue).
4- Click to the Firefox icon 5 times which will enable the debug menu/secret settings for you. (You should see the toast messageDebug menu enabled
once you perform 5 clicks!).
5- Go back to theSettings
via back button.
6- Scroll down to the bottom in theSettings
and check if you see theSecret Settings
(If you do not see theSecret Settings
, you will probably need to revisit the steps 3 and 4).
7- ClickSecret Settings
and check if the"Enable Firefox Suggest"
toggle is enabled or not.
8- Please comment to this ticket whether the toggle was enabled for you or not.Thanks a lot again!
Firefox Suggest not enabled for me either.
Comment 20•1 year ago
|
||
I have the same issue. I am on Firefox Nightly and don't have the Enable Firefox Suggest in secret settings. However all the options for it in search are turned off.
Comment 21•1 year ago
|
||
The Performance Impact Calculator has determined this bug's performance impact to be medium. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.
Platforms: Android
Resource impact: Severe
[x] Able to reproduce locally
[x] Bug affects multiple sites
[x] Multiple reporters
Due to the large number of reporters and severe nature of this issue, I'm going to override the triage calculator and set this to 'high', we probably need some kind of option to mark idle battery drain specifically in the calculator.
Comment 22•1 year ago
|
||
I've been doing some research here. It seems on my Pixel, even when I have Firefox killed and don't use it at all. adb batterystats blames Firefox for a significant amount of CPU usage. This CPU usage seems to roughly match the difference between 'computer drain' and 'actual drain', so I suspect what we're talking about here is not actually real battery drain, but just a bug in how the OS computes battery usage.
Specifically, for the top user, which I believe to be Fx, batterystats reports: UID u0a127: 97.3 ( screen=0.0173 (1s 463ms) cpu=0.879 (23s 137ms) video=96.4 (3h 51m 19s 415ms) wifi=0.000419 (4ms) GPU=0.00253 )
The question now is, if that's true, what is Firefox doing to trigger that bug? Something related to video it would appear.
Comment 23•1 year ago
|
||
(In reply to Kayacan Kaya [:kaya] from comment #11)
Hello :ahmed.milkshake, :Elie Donadio, :pi3c3, :georg.sorst, :Ariano! Thank you so much for providing us your experiences with the app.
We are trying to scope down the reason for the issue you're experiencing so that I would like to know whether the
Enable Firefox Suggest
toggle in theSecret Settings
is enabled for you or not. To check that out, you will need to follow the steps below:1- Open the app that you're experiencing the issue on.
2- Navigate to theSettings
from the 3 dot menu on the app toolbar.
3- Scroll down to the bottom of theSettings
and clickAbout Firefox
(orAbout Firefox Nightly
- depending on which app you're experiencing the issue).
4- Click to the Firefox icon 5 times which will enable the debug menu/secret settings for you. (You should see the toast messageDebug menu enabled
once you perform 5 clicks!).
5- Go back to theSettings
via back button.
6- Scroll down to the bottom in theSettings
and check if you see theSecret Settings
(If you do not see theSecret Settings
, you will probably need to revisit the steps 3 and 4).
7- ClickSecret Settings
and check if the"Enable Firefox Suggest"
toggle is enabled or not.
8- Please comment to this ticket whether the toggle was enabled for you or not.Thanks a lot again!
The toggle is off
Comment 24•1 year ago
|
||
I am also seeing this, both with Firefox Focus and Firefox on Asus Zenfone 9 with Android 14 and the latest production builds. Setting battery usage to Restricted
and turning on Background app management
does not help. Background data
is enabled, though Unrestricted data usage
is disabled.
I do not have the Enable Firefox Suggest
option in my Secret Settings
menu.
Android usually shows battery usage for Firefox or FF Focus between 50-80% of battery drain. Detect battery-draining apps
is enabled, but it doesn't ever report Firefox as doing this. In FF Focus, even if I have no tabs open whatsoever, the drain persists.
Comment 25•1 year ago
|
||
(In reply to thedoc31 from comment #24)
I am also seeing this, both with Firefox Focus and Firefox on Asus Zenfone 9 with Android 14 and the latest production builds. Setting battery usage to
Restricted
and turning onBackground app management
does not help.Background data
is enabled, thoughUnrestricted data usage
is disabled.
What version of Firefox do you see this on? The fix for video landed in 127.0.2. You may need to reboot your phone for the fix to take effect because it works around a bug in the Android mediaserver process.
Comment 26•1 year ago
|
||
Can everyone who experienced this problem ensure that they're running 127.0.2 and have rebooted their phone can check and report whether they still see this issue or not.
Comment 27•1 year ago
|
||
I can confirm that 127.0.2 still has a severe battery drain issue. I did a fresh install (having removed Firefox from my phone a couple of days back due to the issue) verified the version number in the about menu and monitored battery usage. I'm on a pixel 7a with all the latest updates/patches applied.
Comment 28•1 year ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #26)
Can everyone who experienced this problem ensure that they're running 127.0.2 and have rebooted their phone can check and report whether they still see this issue or not.
I installed the 127.0.2 update yesterday and rebooted my phone. I haven't used Firefox since I unplugged this morning but still, Firefox is not even showing up in the battery stats so that could be a good sign. I will report back in a few days once I have more experience.
Comment 29•1 year ago
|
||
(In reply to Graham White from comment #27)
I can confirm that 127.0.2 still has a severe battery drain issue. I did a fresh install (having removed Firefox from my phone a couple of days back due to the issue) verified the version number in the about menu and monitored battery usage. I'm on a pixel 7a with all the latest updates/patches applied.
Did you restart your phone? If you did can you file a new bug with details of the issue you're seeing. You can post a link to it here.
Comment 30•1 year ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #29)
(In reply to Graham White from comment #27)
I can confirm that 127.0.2 still has a severe battery drain issue. I did a fresh install (having removed Firefox from my phone a couple of days back due to the issue) verified the version number in the about menu and monitored battery usage. I'm on a pixel 7a with all the latest updates/patches applied.
Did you restart your phone? If you did can you file a new bug with details of the issue you're seeing. You can post a link to it here.
Yes, I restarted my phone - apologies, I had intended to mention that bit. I'm not sure there's a need for a new bug report, I'm seeing the same one that's reported here.
Comment 31•1 year ago
|
||
My intention is to close this bug and start gathering information on the problem you're seeing. I don't want information from people seeing bug 1902077 mixed in with the problem you're seeing.
Comment 32•1 year ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #25)
(In reply to thedoc31 from comment #24)
I am also seeing this, both with Firefox Focus and Firefox on Asus Zenfone 9 with Android 14 and the latest production builds. Setting battery usage to
Restricted
and turning onBackground app management
does not help.Background data
is enabled, thoughUnrestricted data usage
is disabled.What version of Firefox do you see this on? The fix for video landed in 127.0.2. You may need to reboot your phone for the fix to take effect because it works around a bug in the Android mediaserver process.
At the time I wrote this, I had 127.0.1 installed, but since I installed 127.0.2 and rebooted the phone, I am no longer seeing Firefox as being a top consumer of battery. I just tried playing a video on YouTube and closed out, so we'll see later today if FF stays that way.
Updated•1 year ago
|
Comment 33•1 year ago
|
||
I'm closing this a duplicate of bug 1902077. If you're still seeing a problem please file a new bug.
Updated•1 year ago
|
Description
•