Telegram-FOSS-Team / Telegram-FOSS

Unofficial, FOSS-friendly fork of the original Telegram client for Android
GNU General Public License v2.0
2.9k stars 369 forks source link

Memory/RAM not freed when app swiped away from Recents (8.7.4 - 9.0.2) (Fixed in 9.2.2) #609

Closed opusforlife2 closed 1 year ago

opusforlife2 commented 2 years ago

Version 8.6.2 was working fine in this regard. When using the app, Telegram usually takes up 400-500 MB of RAM. When it is swiped away from Recents, it goes down to ~100-150 MB.

But the 8.7.4 update made it so that swiping away does nothing, and in fact, the app keeps accumulating memory slowly. It has to be force-stopped from settings to stop this behaviour. And then reopened so that the push service can be restarted. After this step, for some reason, the RAM usage stays in the low, expected, range after swiping it away.

opusforlife2 commented 2 years ago

More info: when the app is opened but no chat is opened, the RAM usage stays low. The moment any chat is opened, the memory used skyrockets, jumping up by 500+ MB.

opusforlife2 commented 2 years ago

Bug present in 8.8.5.

ildar commented 2 years ago

would be great to test it on the vendor's own apk from PlayStore.

Barkuti commented 2 years ago

Just dropped by to check the forum. Seriously? Well, the Can't use arrow keys to edit text issue is also present since 8.7.4 (in 8.7.4 and 8.8.5), so it seems like the devs overall cocked up from that version. Still running 8.6.2, of course.

opusforlife2 commented 1 year ago

Without opening any channel, the app shows 1 process, org.telegram.messenger, in Running Services in Developer settings, taking ~150 MB.

When I open a big channel, it shows 2 processes instead of 1. The 2nd process is com.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0. When this process is present, the main org.telegram.messenger process starts taking the huge RAM share mentioned.

Clearing from Recents doesn't end this 2nd webview process.

ristein commented 1 year ago

Screenshot_20221122-205746_Settings

memory full, apps and tabs keep reloading when opening, no multitasking possible. Version 8.6.2 not on F-Droid anymore anything I can do about it?

Barkuti commented 1 year ago

You can download previous versions of standard Telegram from multiple sources. Couldn't find FOSS 8.6.2 easily, so I extracted my arm64-v8a apk and uploaded it to Google Drive: Telegram FOSS v8.6.2-26005 (arm64-v8a). I would really like to know where to chat with the @#$% official Telegram developers, they really need a kick in the arse; really. 🤨😒

ristein commented 1 year ago

@Barkuti thank you. Standard Telegram wont work without g-services. Are you saying this memory bug is present in standard Telegram app as well?

Barkuti commented 1 year ago

… Are you saying this memory bug is present in standard Telegram app as well?

I did not bothered to investigate on that, but fairly sure; check the comment I made back on Aug 15th. After all, it's the devs of Telegram who cocked up. The FOSS version is based on it. And as far as I know, doing a FOSS version of an application is a simple task, a recompilation with different libraries and whatever required minor modifications (most often none). This is just as far as my wisdom goes, a experienced developer could tell you more.

Younes-L commented 1 year ago

Version 8.6.2 not on F-Droid anymore anything I can do about it?

You can download previous versions of standard Telegram from multiple sources. Couldn't find FOSS 8.6.2 easily, so I extracted my arm64-v8a apk and uploaded it to Google Drive: Telegram FOSS v8.6.2-26005 (arm64-v8a).

@Barkuti @ristein to download previous versions of telegram-foss : add the F-droid Archive repo to your f-droid client using the link https://f-droid.org/archive/

or : use izzysoft's convenient front-end (from a web browser) to browse f-droid's archive repo https://apt.izzysoft.de/fdroid/index/apk/org.telegram.messenger?repo=archive

Barkuti commented 1 year ago

Guess that I didn't pay attention to my repositories when ristein asked, but indeed all previous versions of Telegram can be accessed and installed via F-Droid. Thank you Younes-L for pinpointing the location of the F-Droid Archive repository, although there is no need to add it manually, it is in Options -> Repositories within the application. It's best to enable all the repositories, I think. When I previously said “Couldn't find FOSS 8.6.2 easily” what I meant to say is that I didn't find it in alternative sources like Apkpure or Uptodown, for example.

opusforlife2 commented 1 year ago

I didn't bother checking until now because it seemed permanent, but the bug is gone with version 9.2.2!

myghi63 commented 1 year ago

for me it's still leaking memory to a point that the entire app freezes. sometimes even my phone restarts by its own because of that

lem0nez commented 1 year ago

Any updates? I'm on 9.3.3 (Android 12.1) and problem isn't fixed