System drains battery over night

Hi,

this night the battery of my Fairphone 4 (/e/OS 3.6-a14) was drained extremely fast. When I went to sleep at ~23:00 the battery was at roughly 75%. When I first looked at my phone today at ~8:00 the battery was at 10%.

The battery tool showed me that 92-93% of the drain happened by system-apps. When filtering by system instead of apps, it was mostly the CPU (94-97%).

I tried looking at logs to find out what might be the reason but I really can’t deduce anything from the logs. I found out about battery-historian which might have helped but it’s not maintained anymore (and the docker image doesn’t seem to exist anymore..).

It’s not the first time the battery has been drained faster than usual without me using it but it has never been this bad. Also I’m quite sure it’s never been the CPU before.

Are there others experiencing the same? Is there a way to debug this?

1 Like

In a similar case I gave this answer Battery drain on FP6 - #2 by aibd and some useful further debugging follows. As I said there use of CacheCleaner of System apps (especially where battery drain goes bad just after an update) can be a good first step.

2 Likes

I installed the update over a week ago, so it doesn’t seem to be related. On the contrary, I got the feeling that with the update the battery consumption improved. This night was the first incident of this since some time.

If I understand correctly, cleaning the cache of system apps could fix the problem. However, I’d rather find out what’s actually the cause of the problem so that there is a chance it can be fixed in the code.

I installed the CacheCleaner but didn’t feel comfortable using it, it looks really fishy to me, partially because the github repo was archived in march without any information as to why this was done.

Oh and I also went through all the system apps manually to see which one used how much battery. But there was hardly any system app showing battery usage - most of them said there is no usage since last full charge. Seems a bit weird to me as I’m pretty sure some of them had been running - are there system apps which show this message even though they did use the battery?

Oh, that’s bad news. It was always a useful and understandable tool for exactly one task. One run after each system update. - There’s another tool in F-Droid called somehow SD Maid also able to clear caches one by one. But this tool can also clear other stuff and the UI is not at all helpful with that. You can damage a lot of apps if you don’t pay attention.

Would be a good opportunity to add finally a system tool for that. This could even start automatically each time after a system update has been finished, this would reduce a lot of questions about battery drain.

@kmartin88 In the meantime, to sa​:blush:ve the morning frustration, I close my phone down completely. Wait a few minutes and turn it on only in emergency call mode. 100% at night and 95% or higher in the morning. Then I turn it on to use it.

Until now, this didn’t happen again. Battery drain over night was really low, heavy usage by day led to a drain from 100% to ~45% - that’s fine for me. Which is still not as much as was happening that one night while not using it at all.

I remembered that I did something different the day before than I do normally: when the battery was low, I didn’t let it charge until it was full (that’s what I normally do) and later I did the same thing again which is why it was at 75% when I went to bed. So it only partially charged twice in a day and following that, the drain was so bad. Maybe this might have to do something with it?

I would say discharging over night has improved a lot. Years ago my device did lose about 10..12% per night in flight mode, now with 3.6 it’s about 6%.

Don’t think so. The battery should not notice this anymore (as it has been ten years ago). I often don’t charge completely full. I guess you had an uncontrollable process hanging and running without a UI. At least after the next reboot this process has probably gone and it didn’t happen anymore.

Well, I didn’t reboot at all since then.

But the energy saving mode has been disabled after I fully charged the phone again. So maybe enabling or later disabling the energy saving mode did something to the process in question, fixing it.

But this is always a good idea in such cases. If you have any uncontrolled process in background by whatever damned reason you have no other choice to stop it. And there’s a good chance that it runs normal when the system comes up again.

2 Likes

Thanks for the update on CacheCleaner being archived. That was sad to see. There were problems at update to a13, but those got fairly well corrected for my devices.

Good to hear that it seems to have been a one off event.

The Quick settings menu after a second pull down will show a link to Active apps at the foot of the page. I would guess yours was some rogue event that time, but it can be useful to know the apps that continue to run in the background. This feature also allows to quick close any such app.

I know this active apps menu. There are always 2 apps that can’t be closed: ntfy and Active Privacy. I check this quite often as I’ve had some problems in the past with too much battery usage - since then I use this to close apps.

So maybe ntfy or Active Privacy was the culprit? They should both be system apps I guess. There was quite a bit of noise by Active Privacy in the log, but I don’t know if that’s normal. Maybe I could check the log from today to see if it looks the same.

My guess is a process (a running app) you couldn’t see easily because it had no GUI. Either not at all, this is the case for a lot of system processes and services, or not anymore, this can happen when a GUI process doesn’t terminate correctly after it’s window has been closed or after a crash.

Note: the window you see from a process is not the process and the process is not the window. A GUI process has a life before it’s window and a life after it’s window. Typically these time spans are very short but it can happen that the app still does things, loops endlessly, deadlocks itself, crashes and consumes a lot of energy depending on how long it runs this way. A reboot solves this.

To be sure, I would reboot the phone every morning.

1 Like