I can't point my finger at any one reason for this, but anecdotally I've found RiotX to use a large amount of power compared to it's usage time. @anoadragon453 and @babolivier can confirm this as well.
For example, for around a hour of reported screen time, RiotX had taken 25% of the total power draw for that day.
(I am using the gplay build)
Yep, made my phone only last 1/3rd of a day.
I have not noticed this (using the F-Droid build)
Can confirm, on my other phone installing and starting using RiotX made my battery life drop from around a day to less than 10h.
I looked again after matrix sync this morning and it's used 6% of my charge so far today. This seems to be related to some background tasks the app is running, because a lot of the charge seems to be drained while the phone is idle.
The google play version isn't trying to sync, is it?
My RiotX installation (from Google Play Store on Galaxy S8 running Android Pie) has been perfectly fine on battery life. 0.7% since about four hours ago, with very light usage.
We just have fixed an issue (in v0.5.0 release): Riot was syncing continuously, even if when in background, when the network was back (ex: when exiting airplane mode).
It should be better now.
After update to 0.5.0-dev [10000500] (G-07fca092) RiotX begin "eat" 30% of battery.
This is occur after bad network connectivity. And continuous after network resume to good connectivity.


Considering the fact that RiotX should replace old Riotâ„¢ we need to deal with this problem ASAP.
I am running pure LineageOS without GCM (or recently FCM?) and RiotX consumes _at least ~30%_ of my battrry life (not to mention that this issue directly related to notifications, for example I receiving them with ~8 minutes delay or not receiving at all) that prevents me using RiotX in general. This is disaster for mobile phones. There is similar issues dating from 2016 that people experienced and still not fixed even at the end of 2019:
Taking into account that Matrix is good and actively developing IM alternative to XMPP _(which lacks development for clients, not to mention XEP's, that you should check for both server and client)_, Signal _(that requires phone number, centralized and not available in F-Droid (see this good article))_ and Wire _(which has shaddy Privacy Policy (see this))_ we need to implement proper syncing solution which fixes both notification and battery issues.
Like what was mentioned in #3152 I think we should implement SSE (Server Sent Events), considering that PR for SSE is ready for review – matrix-doc#2108 and matrix-doc#2024 for reference.
Is this still true or can this be closed? I never experienced an energy issue in the last three/four months.
RiotX still represents around 80% of my phone's battery usage. I'm running the dev build, though, which I know has more checks and works more than the mainline version, but I'd be surprised if that amounted to such a huge increase in battery usage.
Still draining a lot of battery, especially without Google Play Services
@fbruetting Are you using RiotX with FCM/Google Play Services? Because if yes, then you should consider reading my previous message.
Also, I've found that in order to receive messages from RiotX I need to _keep the application open in the background and never close it._ Some applications from F-Droid (Linphone, Telegram) use persistent notification hack that will always appear in notifications bar (this will insure that app will always be running in foreground no matter what [1]), so I could close them and receive messages/calls nevertheless. Could be this changed in RiotX to match this behaviour?
_IMHO,_ I still consider SSE best option available (it uses small amount of battery life and handles (pushing/recieving) messages very well). [2]
[1] [Telegram push notification issue](https://github.com/Telegram-FOSS-Team/Telegram-FOSS/issues/255)
[2] [Article about Tutanota implementing SSE](https://f-droid.org/en/2018/09/03/replacing-gcm-in-tutanota.html)
I can also verify the issue.
I am quite surprised that without GCM (the devil needs/likes to change its name👹) a quality notification system is still missing.
As a note, TutanotA also solved it with SSE. Until then, I have to use the Play version with E2E rooms, because 3000mAh is not enough for busy day otherwise.
Edit: @shumvgolove sorry, didn't realize your link is the same as mine, your link title didn't mention tutanota.
@Samonitari Fixed the title to clarify things. Also, no problem mate.
I setup batterystat,wait and get situation with large battery use by RiotX (0.17-gplay):







Sorry for big images :-(
Any update on this? Currently on F-Droid release 0.19.0 on a non-rooted Android (so I have Google Play Services) and still experiencing massive battery drain (7% - 261 mAh - in just over an hour, until I forcibly stopped the app).
Is going through the Play Store the only option for now?
This is a major blocker for me and why I switched back to Riot. RiotX just uses too much battery.
In Riot I have set the sync interval to 600 seconds so it only syncs every 10 minutes, my battery lasts for several days that way. With RiotX I have to recharge every day.
the same for me. syncing every 10, 20 or even 60 minutes would be fine for most cases. Did You consider adding configuration option to customize it?
Matrix devs dont even understand their own demographics; they're building an 'open system' except that you need google to use it ... this is fucked!
edit: Conversations has push, so what the fuck guys!?
Matrix devs dont even understand their own demographics; they're building an 'open system' except that you need google to use it ... this is fucked!
edit: Conversations has push, so what the fuck guys!?
Well, I am unhappy as well, but:
YOU don't understand it seems, and you are also unneccesarily offensive.
Techincally you don't HAVE to use google, although if on Android (you can use other platforms...) you choose to do so, it will drain a lot more. And the sad thing is, most app on Android use Google servers and its services. I use MicroG and I know how many of my apps do... If it is an IM app, then it is the ONLY straightforward way, and Google actively makes it less and less feasible for any alternative method (inhibiting running non-system background apps without notification, etc.). So if you want to blame somebody, that is your place.
Conversations keeps its own connection to the server, and F-Droid version of Riot is a bit more clumsy true. But the ideal way is something like openpush, if Conversation's devs would contribute to a generalized solution like that, now that would be fantastic!
Matrix devs dont even understand their own demographics; they're building an 'open system' except that you need google to use it ... this is fucked!
edit: Conversations has push, so what the fuck guys!?Well, I am unhappy as well, but:
YOU don't understand it seems, and you are also unneccesarily offensive.Techincally you don't HAVE to use google, although if on Android (you can use other platforms...) you choose to do so, it will drain a lot more. And the sad thing is, most app on Android use Google servers and its services. I use MicroG and I know how many of my apps do... If it is an IM app, then it is the ONLY straightforward way, and Google actively makes it less and less feasible for any alternative method (inhibiting running non-system background apps without notification, etc.). So if you want to blame somebody, that is your place.
Conversations keeps its own connection to the server, and F-Droid version of Riot is a bit more clumsy true. But the ideal way is something like openpush, if Conversation's devs would contribute to a generalized solution like that, now that would be fantastic!
As one of the greatest computer engineers in the world, I understand. What I did was to slap the riot devs across the face, like I would want it done to me, since they are missing their chance to be famous. No push == same as everyone else == not famous. So wake the fuck up! Dont miss this chance, it wont come back.
Note: I wont participate in matrix, is it would distract me actually fixing mankind's logic stack; matrix didnt even come close to 'breaking the mold' ... but it did inspire me 4 years ago to start my research, which shatters the mold. So the matrix fame is all your if you have the courage to pioneer great achievements. If riotx gets push, Ill get you thousands of paying customers ... until we have our own solution. If not, you'll never get to be called 'the world's communication protocol' even if it was just for a few months. For those curious about my project, come on matrix at #sajban-dev:matrix.org ... until its hosted on sajban.xyz
Cheers! Dont let swear words put you down, use them to refocus your energy on your work.
At some days ago I get such situation:
You can see at first screenshot as at ~16:00 I stop RiotX service and start it again - and drain battery was stopped:


May be I found when element eat battery:
And I was send logs from phone at this moment.
Element/RiotX and the whole Matrix project is super cool. I really appreciate all the work done for this project. :+1:
Unfortunately Element/RiotX is always number one battery consumer of my LineageOS smartphone.
As already mentioned I would also think Server Sent Events (SSE) is the best available solution after using Conversations for quite some time, which uses SSE. Nearly no battery consumption compared to Element and still the notifications are super fast and reliable. Hopefully Synapse will integrate SSE :crossed_fingers:
From changelog of v1.0.2:
Sending events is now retried only 3 times, so we avoid blocking the sending queue too long.
So will be good to recheck this issue in this version.
From changelog of v1.0.2:
Sending events is now retried only 3 times, so we avoid blocking the sending queue too long.
So will be good to recheck this issue in this version.
In new version of element messages offten sended success (at bad network), but I found bug: message freeze at down of messages window and I was can not remove it, or send.
And this time I found, that element begin again drain battery.
Freeze image on down message window:

All new messages added upper of this freezes image.
@progserega This is likely a separate bug (and the battery impact is probably more of a common symptom), can you open a separate issue about it please?
@progserega This is likely a separate bug (and the battery impact is probably more of a common symptom), can you open a separate issue about it please?
Okey
today new element (1.0.3 Google servises)
Eat 30% of battery (more then 1 hour - it was use CPU), when phone was in sleep mode (end of graph):



@progserega This is likely a separate bug (and the battery impact is probably more of a common symptom), can you open a separate issue about it please?
Hello, just sharing some results of investigations here.
A note, that this is hard to measure because element activity will depend a lot of your account.
I'd prefer to separate this issue in two issues, one for the playstore version and another for the f-droid version.
Regarding fdroid, element will try to sync every 30s, so depending on your account it could sync every 30s even if you have no notifications (and if you have a lof rooms it could sync a lot of data), and do that until you have no more battery
For playstore, if you have no push (notification) the app will never sync. But if you have a setup with lot's of rooms with high priority notifications settings, the app could sync permanently
The fdroid mechanism could be improved by adding more settings, or checking for other API to check for notification and only sync when needed (hopefully the light polling would be less battery heavy). Old riot had a 'battery optimized' mode, that will slow the sync period when battery gets lower or phone stayed still (doze), element android does not have it yet
I have run tests with old riot and element android, for a single sync with one message, the energy/cpu profiles for old riot and element are quite similar; the Memory usage is quite different though, but should not impact battery.
May be I found when element eat battery:
1. bad/down network 2. user send message/image 3. it can not send by element - freeze in his cache (such as #1706 ) 4. network up 5. element try send unsended messages - and it is unsuccesfull - this repeat again and again. Element in battery stat use CPU and battery drainAnd I was send logs from phone at this moment.
Regargin resending, there are two retries mecahnism involved:
With this PR https://github.com/vector-im/element-android/pull/1889 the behavior has been modified a bit; now big upload requests will only be one shot (mainly to protect your data plan and not battery)
I will close this issue, as the original issue was due to a bug on early riotX that was syncing continuously in background.
Please fell free to open new issue for fdroid
See https://github.com/vector-im/element-android/issues/2055 for work on fdroid version
Most helpful comment
Considering the fact that RiotX should replace old Riotâ„¢ we need to deal with this problem ASAP.
I am running pure LineageOS without GCM (or recently FCM?) and RiotX consumes _at least ~30%_ of my battrry life (not to mention that this issue directly related to notifications, for example I receiving them with ~8 minutes delay or not receiving at all) that prevents me using RiotX in general. This is disaster for mobile phones. There is similar issues dating from 2016 that people experienced and still not fixed even at the end of 2019:
Taking into account that Matrix is good and actively developing IM alternative to XMPP _(which lacks development for clients, not to mention XEP's, that you should check for both server and client)_, Signal _(that requires phone number, centralized and not available in F-Droid (see this good article))_ and Wire _(which has shaddy Privacy Policy (see this))_ we need to implement proper syncing solution which fixes both notification and battery issues.
Like what was mentioned in #3152 I think we should implement SSE (Server Sent Events), considering that PR for SSE is ready for review – matrix-doc#2108 and matrix-doc#2024 for reference.