Delta.Chat drains battery

#1

Delta Chat version
v0.20.0

Device
Fairphone 2 with Android 6.0.1

Expected behavior
App should not use so much battery capacity

Actual behavior
Delta.Chat drains the battery: in the battery statistics of the operating system Delta.Chat uses most of the capacity, far more than any other app and I have to charge the smartphone more often as before without Delta.Chat.

Steps to reproduce the problem

  1. install Delta.Chat
  2. setup Delta.Chat
  3. wait and watch the battery draining …

Screen snapshots

Debug logs

Logs © 2017, 2018 Delta Chat contributors

Chats: 11
Chat messages: 21
Messages in contact requests: 197
Contacts: 730
Database=/data/user/0/com.b44t.messenger/files/messenger.db, dbversion=40, Blobdir=/data/user/0/com.b44t.messenger/files/messenger.db-blobs

displayname=Martin Milinovsky
configured=1
config0=martin@milinovsky.at martin_@milinovsky.at:***:imap.world4you.com:0 martin_@milinovsky.at:0:smtp.world4you.com:0 0
config1=martin@milinovsky.at martin_@milinovsky.at:***:imap.world4you.com:993 martin_@milinovsky.at:***:smtp.world4you.com:587 AUTH_NORMAL IMAP_SSL SMTP_STARTTLS
mdns_enabled=1
e2ee_enabled=1
E2EE_DEFAULT_ENABLED=1
Private keys=1, public keys=2, fingerprint=
D1CE 3DF7 18CB AC38 53F0
7160 908C DF13 EEF1 237A

Using Delta Chat Core v0.20.0, SQLite 3.23.1-ts1, libEtPan 1.8, OpenSSL 1.0.1t. Compiled Aug 15 2018, 15:46:32 for 32 bit usage.

Log excerpt:

22:40:31 IMAP-IDLE ended.
22:40:31 IMAP-jobs started…
22:40:31 IMAP-jobs ended.
22:40:31 IMAP-fetch started…
22:40:31 0 mails read from “INBOX”.
22:40:31 IMAP-fetch done in 2 ms.
22:40:31 IMAP-IDLE started…
22:40:38 Interrupting SMTP-idle…
22:40:38 SMTP-idle ended.
22:40:38 SMTP-jobs started…
22:40:38 SMTP-job #1, action 5900 started…
22:40:38 SMTP-server smtp.world4you.com:587 STARTTLS-connected.
22:40:39 SMTP-login as martin_@milinovsky.at ok.
22:40:39 Interrupting IMAP-IDLE…
22:40:39 IMAP-IDLE interrupted.
22:40:39 IMAP-IDLE ended.
22:40:39 IMAP-jobs started…
22:40:39 SMTP-jobs ended.
22:40:39 SMTP-idle started…
22:40:39 IMAP-job #2, action 700 started…
22:40:39 Appending message to IMAP-server…
22:40:39 Message appended to “DeltaChat”.
22:40:39 IMAP-jobs ended.
22:40:39 IMAP-fetch started…
22:40:40 0 mails read from “INBOX”.
22:40:40 IMAP-fetch done in 13 ms.
22:40:40 IMAP-IDLE started…
22:41:33 IMAP-IDLE has data.
22:41:33 IMAP-IDLE ended.
22:41:33 IMAP-jobs started…
22:41:33 IMAP-jobs ended.
22:41:33 IMAP-fetch started…
22:41:33 0 mails read from “INBOX”.
22:41:33 IMAP-fetch done in 3 ms.
22:41:33 IMAP-IDLE started…
22:41:39 SMTP-idle ended.
22:41:39 SMTP-jobs started…
22:41:39 SMTP-jobs ended.
22:41:39 SMTP-idle started…
22:43:33 IMAP-IDLE has data.
22:43:33 IMAP-IDLE ended.
22:43:33 IMAP-jobs started…
22:43:33 IMAP-jobs ended.
22:43:33 IMAP-fetch started…
22:43:33 0 mails read from “INBOX”.
22:43:33 IMAP-fetch done in 2 ms.
22:43:33 IMAP-IDLE started…
22:45:34 IMAP-IDLE has data.
22:45:34 IMAP-IDLE ended.
22:45:34 IMAP-jobs started…
22:45:34 IMAP-jobs ended.
22:45:34 IMAP-fetch started…
22:45:34 0 mails read from “INBOX”.
22:45:34 IMAP-fetch done in 2 ms.
22:45:34 IMAP-IDLE started…
22:45:34 SMTP-idle ended.
22:45:34 SMTP-jobs started…
22:45:34 SMTP-jobs ended.
22:45:34 SMTP-idle started…
22:47:33 IMAP-IDLE has data.
22:47:33 IMAP-IDLE ended.
22:47:33 IMAP-jobs started…
22:47:33 IMAP-jobs ended.
22:47:33 IMAP-fetch started…
22:47:33 0 mails read from “INBOX”.
22:47:33 IMAP-fetch done in 2 ms.
22:47:33 IMAP-IDLE started…
22:49:33 IMAP-IDLE has data.
22:49:33 IMAP-IDLE ended.
22:49:33 IMAP-jobs started…
22:49:33 IMAP-jobs ended.
22:49:33 IMAP-fetch started…
22:49:33 0 mails read from “INBOX”.
22:49:33 IMAP-fetch done in 2 ms.
22:49:33 IMAP-IDLE started…
22:51:33 IMAP-IDLE has data.
22:51:33 IMAP-IDLE ended.
22:51:33 IMAP-jobs started…
22:51:33 IMAP-jobs ended.
22:51:33 IMAP-fetch started…
22:51:33 0 mails read from “INBOX”.
22:51:33 IMAP-fetch done in 2 ms.
22:51:33 IMAP-IDLE started…
22:51:35 SMTP-idle ended.
22:51:35 SMTP-jobs started…
22:51:35 SMTP-jobs ended.
22:51:35 SMTP-idle started…
22:53:34 IMAP-IDLE has data.
22:53:34 IMAP-IDLE ended.
22:53:34 IMAP-jobs started…
22:53:34 IMAP-jobs ended.
22:53:34 IMAP-fetch started…
22:53:34 0 mails read from “INBOX”.
22:53:34 IMAP-fetch done in 2 ms.
22:53:34 IMAP-IDLE started…
22:54:20 IMAP-IDLE has data.
22:54:20 IMAP-IDLE ended.
22:54:20 IMAP-jobs started…
22:54:20 IMAP-jobs ended.
22:54:20 IMAP-fetch started…
22:54:20 Receiving message INBOX/22635…
22:54:20 Message has 1 parts and is assigned to chat #74.
22:54:20 1 mails read from “INBOX”.
22:54:20 0 mails read from “INBOX”.
22:54:20 IMAP-fetch done in 34 ms.
22:54:20 IMAP-IDLE started…
22:55:33 IMAP-IDLE has data.
22:55:33 IMAP-IDLE ended.
22:55:33 IMAP-jobs started…
22:55:33 IMAP-jobs ended.
22:55:33 IMAP-fetch started…
22:55:33 0 mails read from “INBOX”.
22:55:33 IMAP-fetch done in 2 ms.
22:55:33 IMAP-IDLE started…
22:56:22 SMTP-idle ended.
22:56:22 SMTP-jobs started…
22:56:22 SMTP-jobs ended.
22:56:22 SMTP-idle started…
22:56:55 IMAP-IDLE has data.
22:56:55 IMAP-IDLE ended.
22:56:55 IMAP-jobs started…
22:56:55 IMAP-jobs ended.
22:56:55 IMAP-fetch started…
22:56:55 0 mails read from “INBOX”.
22:56:55 IMAP-fetch done in 2 ms.
22:56:55 IMAP-IDLE started…
22:57:22 SMTP-idle ended.
22:57:22 SMTP-jobs started…
22:57:22 SMTP-jobs ended.
22:57:22 SMTP-idle started…
22:57:33 IMAP-IDLE has data.
22:57:33 IMAP-IDLE ended.
22:57:33 IMAP-jobs started…
22:57:33 IMAP-jobs ended.
22:57:33 IMAP-fetch started…
22:57:33 0 mails read from “INBOX”.
22:57:33 IMAP-fetch done in 3 ms.
22:57:33 IMAP-IDLE started…
22:58:36 SMTP-idle ended.
22:58:36 SMTP-jobs started…
22:58:36 SMTP-jobs ended.
22:58:36 SMTP-idle started…
22:58:49 IMAP-IDLE timeout.
22:58:49 IMAP-IDLE ended.
22:58:49 IMAP-jobs started…
22:58:49 IMAP-jobs ended.
22:58:49 IMAP-fetch started…
22:58:49 0 mails read from “INBOX”.
22:58:49 Ignoring “Junk”.
22:58:49 Ignoring “Drafts”.
22:58:49 0 mails read from “Papierkorb”.
22:58:49 Receiving message DeltaChat/7…
22:58:49 Message already in DB.
22:58:49 1 mails read from “DeltaChat”.
22:58:50 Folder “Gesendet” is empty.
22:58:50 0 mails read from “Gesendet”.
22:58:50 0 mails read from “Maturaball Max 2018”.
22:58:50 Ignoring “Trash”.
22:58:50 Folder “Entw&APw-rfe” is empty.
22:58:50 0 mails read from “Entw&APw-rfe”.
22:58:50 0 mails read from “Sent”.
22:58:50 0 mails read from “Tickets, Reservierungen etc”.
22:58:50 Folder “Archives” is empty.
22:58:50 0 mails read from “Archives”.
22:58:50 0 mails read from “50er Claudia”.
22:58:50 0 mails read from “INBOX”.
22:58:50 IMAP-fetch done in 60 ms.
22:58:50 IMAP-IDLE started…
22:59:33 IMAP-IDLE has data.
22:59:33 IMAP-IDLE ended.
22:59:33 IMAP-jobs started…
22:59:33 IMAP-jobs ended.
22:59:33 IMAP-fetch started…
22:59:33 0 mails read from “INBOX”.
22:59:33 IMAP-fetch done in 1 ms.
22:59:33 IMAP-IDLE started…
23:01:12 SMTP-idle ended.
23:01:12 SMTP-jobs started…
23:01:12 SMTP-jobs ended.
23:01:12 SMTP-idle started…
23:01:32 IMAP-IDLE has data.
23:01:32 IMAP-IDLE ended.
23:01:32 IMAP-jobs started…
23:01:32 IMAP-jobs ended.
23:01:32 IMAP-fetch started…
23:01:32 0 mails read from “INBOX”.
23:01:32 IMAP-fetch done in 1 ms.
23:01:32 IMAP-IDLE started…
23:02:12 SMTP-idle ended.
23:02:12 SMTP-jobs started…
23:02:12 SMTP-jobs ended.
23:02:12 SMTP-idle started…
23:02:57 IMAP-IDLE timeout.
23:02:57 IMAP-IDLE ended.
23:02:57 IMAP-jobs started…
23:02:57 IMAP-jobs ended.
23:02:57 IMAP-fetch started…
23:02:57 0 mails read from “INBOX”.
23:02:57 IMAP-fetch done in 2 ms.
23:02:57 IMAP-IDLE started…

SDK_INT=23
MANUFACTURER=Fairphone
MODEL=FP2
APPLICATION_ID=com.b44t.messenger
BUILD_TYPE=release
ABI=ErrAbi
ignoreBatteryOptimizations=0
versionCode=536

2 Likes
#2

hi @mmilinovsky welcome aboard - and thank you for your post :slight_smile:

would be interesting if the high battery consumption appears when the app is in idle or if it is used. if the latter case, higher battery consumption is quite normal. the log looks good to me at a first glance.

in general, we had reports about battery usage in the past here and there, but many users these day report the battery usage is “okay” (eg. here).

so, any more information would be useful, maybe also other users will have similar problems, we will see :slight_smile:

#3

There is an open issue, that can cause battery drainage.
See my postings one and two.

Update: The referenced issue was closed in January 2019 and released in Core v0.39.1 (Android + Desktop v0.100.0).

1 Like
#4

I installed the app on my phone and on my wife’s, but we don’t use it until now, so to answer you question: the high battery consumption appears when the app is idle.

#5

At this point, it’s unfortunately unclear if the android-reported battery usage is “real”.

Could you maybe run delta.chat and leave the phone for the night (starting out fully charged)
and see where the battery level is then? And then repeat but without running Delta.Chat?
That would be super-helpful.

#6

Martin, it looks to me as you are using an account that is receiving many (standard) mails:

Chat messages: 21
Messages in contact requests: 197
Contacts: 730

Delta Chat sees these mails and “hides” them in ‘Contact requests’ = ‘Kontaktanfragen’. It downloads those mails and also their attachments. So, even if you do not use/open the app, it is actively checking your INBOX “in the background”.

#7

Yeah, couldn’t deltachat only download the list of new emails (unfortunately still called “contact requests”) by default, and download the whole messages only for the known contacts (if message sizes are small enough or contact has a “default to chat” preference set). Not succeeding with deltachat (MUA better than a messenger)

#8

OK, the phone was nearly full (94%) and the screenshot shows the situation in the morning

#9

Thanks for posting the info!

And if you don’t run DeltaChat, how does the battery develop?

a battery usage of 7% over night does not look very problematic, does it?

#10

It is 700% above the usual 1% (or less) here.

But 7% of the overall usage could be very little in absolute measures, if there is nothing else running (customized rom?).

#11

Martin, would you try to get more detailed info using another app?

The app is called BetterBatteryStats. Details here.

One can easily check the Wakelock (Partial Wakelocks), Network and Process stats of all apps.

#12
#13

OK, I installed BetterBatteryStats, although I’m not very comfortable granting superuser access to it (thank you for the link to the sources at github). However, I will post the results in the next days …

2 Likes
#14

I have the same issue since some days only… the Delta.chat apk (Version) was not changed.
I then removed Delta.chat from Excemption list for battery optimization. Did not help.

I use dismail.de as email-account for Delta.chat only, thus there is no other traffic.

my only idea is that something in Google Services like (Google Cloud Messaging) was changed that negatively affects battery consumption of Delta.chat.

P.s. I have delta chat battery consumption between 47% (active use of phone) an 95% (inactive use of phone).

#15

Hum, when you discover that battery consumption has been high, could you maybe save the debug log and make it available somehow? Not sure how easy it is to discover if delta-chat has been the culprit from it but it’s worth a try. On my side i’ve been using delta-dev for weeks and battery behaviour was quite fine – often, even while using the device, it lastest almost 2 days.

#16

Actually i (at least temporarily) solved the issue in cleaning all past chats / mails in the app. my guess is that the issue was that on the server the messages were deleted but in the app still existing, thus it could be the try of the app to resync all the messages which was not possible as they were deleted from the server.

#17

@thorsten
Maybe You can see extraordinary communication here (log-ring-buffer):
“settings->About Delta Chat(press this text)->(press version info text in next screen)”
I hope this is existing in the newest version?!

#18

I also experience battery drain on Android. For details incl. log see my repsonse in the corresponding GutHub issue: https://github.com/deltachat/deltachat-android/issues/713#issuecomment-462317469

#19

The following workaround helped on my machine: disable watching the SENT-folder at “Settings / Advanced / Watch Sent folder”.
A fix which makes this workaround obsolete is targeted for next release.

#20

Herre is my Screenshot from my Android Android 8.0 Samsung S7 Edge.