michaelkourlas / voipms-sms-client

Popular Android messaging app for VoIP.ms, a Canadian VoIP provider
https://play.google.com/store/apps/details?id=net.kourlas.voipms_sms
Apache License 2.0
218 stars 52 forks source link

Performance issue/hangs in 0.6.6 #217

Closed mang1ed closed 3 years ago

mang1ed commented 3 years ago

0.6.6 fdroid version appears to freeze and or would take long during sync and or when loading keyboard/minimising the app (having to force close the app). I tried to reinstall the app and clearing data/cache. App works fine for the first few messages and then starts to hang. I had to revert to 0.6.5 as this one works great on my device. I'm running /e/ on a note 3.

michaelkourlas commented 3 years ago

I've gotten multiple reports of this and the common factor seems to be older versions of Android. (The app works fine on my own device -- Pixel 2 XL running Android 11.)

Some changes made that might be related:

Other than that, I don't know what the cause might be.

mang1ed commented 3 years ago

My device is running android 7.1.2. There could be an incompatability with the libraries like you've mentioned.

baldurmen commented 3 years ago

I have similar issues running the 0.6.6 version of the app on Android 9. Certainly not the latest version, but I wouldn't say it's "old" :)

LinearDynamics commented 3 years ago

Also experiencing this issue from the recent update. In Android settings>Battery>Advanced, Voip.ms SMS app used 21% since last full charge. UI doesn't load message threads. Android 10, OnePlus 6t(Oxygen 10.3.5). In the meantime, I'm using the not so great web page for my SMS https://voip.ms/m/communications.php

michaelkourlas commented 3 years ago

Unfortunately, I'm at a loss. I'm just not experiencing these issues, so I don't know what's causing them.

michaelkourlas commented 3 years ago

A user said that rebooting fixed the problem with the latest version. I wonder...

At first I thought this was happening because there were multiple OkHttp client instances. That probably didn't help, but it sounds like fixing that didn't fix the underlying problem, which is some kind of memory leak.

Based on this StackOverflow question, I think this is because I'm not closing the HTTP connection.

Will quickly release an update to fix this.

michaelkourlas commented 3 years ago

Actually, never mind, I was already closing the response.

michaelkourlas commented 3 years ago

@LinearDynamics -- what happens if you restart your device? Does the problem go away for you too?

LinearDynamics commented 3 years ago

@LinearDynamics -- what happens if you restart your device? Does the problem go away for you too?

Unfortunately, no. I did try that yesterday. Also today. Performed an uninstall/reinstall(with login to the API) but phone became noticeably hot after each test. In a bit I was going to try to delete the database, uninstall, set the synch start to August and retest. Not sure if that would be a worthwhile effort. When initially starting the app, I can(sometimes) load the sms threads and reply however after a minute the unresponsiveness begins to occur.

michaelkourlas commented 3 years ago

In a bit I was going to try to delete the database, uninstall, set the synch start to August and retest. Not sure if that would be a worthwhile effort.

It might be. This might be a scaling issue.

LinearDynamics commented 3 years ago

Ok, I set synch date to September 15,deleted dB, cleaned up. In the past 10 minutes I'm able to send messages to my own DID. Works quickly and reliably. My phone is not getting the heat blast like it was before. So for now, I'll keep the synch start as is and report back.

yulman19 commented 3 years ago

I'm not sure i'm in the good thread, but since last update i'm having a lot of troubles with the app similar to the ones mentionned with a fresh DB. Android 11 on a Pixel 3a.

michaelkourlas commented 3 years ago

I'm just going to start using IntentService again. I don't care that it's deprecated -- the implementation is super straightforward. I'll just make my own copy in case they ever remove it.

AMDSeb commented 3 years ago

I'm just going to start using IntentService again. I don't care that it's deprecated -- the implementation is super straightforward. I'll just make my own copy in case they ever remove it.

Thanks a lot once again for your work. I was also experiencing very long waits when sending messages (1-2 minutes) since the last version update. Running Android 8 (annoying manufacturers, should be mandatory to keep updating for a certain period). I was about to post to see if I could help pinpoint the problem, but saw you had published a new version. Just tried it and it seems back to normal, no more hangs. Thanks again!

michaelkourlas commented 3 years ago

That's great to hear! If 0.6.8 fixed things for anyone else -- or if the problem's still there -- please let me know.

LinearDynamics commented 3 years ago

I extended my synch time back to 2018. All messages are present and performance seems normal.

michaelkourlas commented 3 years ago

I think the problem here, for reference, was that I was using WorkManager incorrectly -- the work was running on the UI thread.