LineageOS 20: RAM always full – can't really multi-task

Hello dear Fairphoners,

for quite some time I’m experiencing severe memory and/or performance problems with my 3-year-old Fairphone 3+ running LineageOS 20 that severely impact everyday performance and multi-tasking.

Example: After some up-time, switching between the last two or three open apps often has the effect that apps do not remember their state, e.g. OrganicMaps shows its start-up logo screen and then slowly renders its map and returns to routing. Or Firefox can’t keep the content of two tabs in mind at the same time (switching to other tab reloads it from scratch). :tired_face:

OS Monitor app from F-Droid says that of 3,8 GB RAM, there’s only a two figure amount free, usually around 75 MB, sometimes up to 110 MB, sometimes down to 45 MB. :thinking:

  • LOS 20 latest build (upgraded dirty from 19 a long while ago) running without MicroG/Google Services.
  • Yes, I have quite a few apps installed from F-Droid, but nothing too fancy, no bloated commercial apps, no huge games. At least, from my point of view, that is. (Signal, Threema, Telegram, K9mail, OrganicMaps, Firefox/Fennec, NeoStore, NeoLauncher, AuroraStore, NetGuard with a hosts file, DAVx5, some Fossify apps, Nextcloud, DB Navigator, some public transportation apps, to name a few.¹ In sum, an amount of apps and services my FP2 used to be easily capable of handling, IIRC.)
  • Restarting the device seems to help, but only for a short period.
  • Yes, I’m aware of the „free RAM is wasted RAM“ and „just leave memory management to the system“ take. But to me the system seems to aggressively kill app processes to free some RAM resources.
  • Yes, I have to SIM cards installed (one rather old, the other three years old, like the phone).
  • Yes, I have a 128 GB microSD card installed (which might not be the ultra super-duper very fastest model around), but I haven’t moved any apps onto it.
  • Yes, internal storage still has at least 20% free space, sdcard is roomy, too.
  • No, CPU usage is not the bottleneck, around 4-7% when idle. Also, no thermal issues (at least none that correlate.)
  • Yes, I have taken it apart a few times, cleaned contacts etc.
  • No, I’d rather not wipe and reinstall LineageOS and start fresh. This isn’t Windows 98 and shouldn’t just become unusable just by friggin’ using it over time. Backing up and restoring stuff like e.g. Signal is an every-changing and unreliable P.I.T.A., LineageOS internal backup is hardly useful.
  • No, it does not have warranty anymore and sending it to FP support for a few weeks is totally not an option (see previous bullet point).
  • Yes, I have Developer Options activated, but just for adb/scrcpy/fdroidcl’s sake, nothing special activated there, I think. („Limit for background processes“ is set to default).

As of today I installed Magisk and rooted my device to gain a better insight into app and core memory consumption with OS Monitor, but there’s nothing that jumped into my eye like some memory leaking runaway app or so.
The RAM usage statistics in Developer Options say that ~2.8 GB were used on averagein the last 24 hours) and that Android OS and Android System UI are the largest single consumers with about 1.5 GB of RAM.

Do you have any ideas? Is it normal? (My FP2 felt more responsive, though.)
What other approaches can I try to inspect memory usage (without being an Android developer and ‘adb’ superuser?)
Would it make sense to delete certain cashes via adb/recovery or so?

Thanks for taking the time to read all this :innocent:

Regards


¹ Unfortunately, without root I can’t prevent apps from starting on boot (e.g. via Autostarts app) rather than only on demand, which I’d clearly prefer.

This is something I’ve spent a lot of time trying to workaround, but ultimately 4GB is simply not enough for modern Android and apps.
Many messengers will eat up 300MB each, and browsers with a few tabs 1.5GB, on top of the system itself typically taking 2GB.
This issue has especially gotten worse as the RAM is shared among the GPU itself, so many phones have gotten higher resolution screens without upping RAM further exacerbating it.

While somewhat specific to my DivestOS, I have a writeup on this here: Faq - DivestOS Mobile

There were Android 6.0 (2015) phones that shipped with 6GB of RAM.

This is likely the memory specifically available to that app (ie. Java heap), and not the system.
Please use Settings > Developer options > Running services instead for a truly accurate account.

Also please do not trust the “Settings > Developer options > Memory” screen as it instead shows a rolling average and not true count like the “Running services” menu.

Hi,

thanks for your help. Will check the link tomorrow.

Ahh, that makes sense!

Ah, this is where I could see something eating up available mem by the minute without me doing anything, like a memory leak. But the ranking and numbers below didn’t change, so I couldn’t identify a culprit.

Yes, that’s what I figured, that menu wasn’t much of an insight.

Regards

I had this problem when using Firefox. What I also noticed is when I try to clean the cache or storage of the Firefox app, the phone completely hangs for a small moment. Like 10 seconds.

I started to use Microsoft Edge instead and it was a bit better. Also, do not open too much tabs. Every tab seems to take a bit of memory. In the Dev Tools when connected to USB I can see all tabs, although without any content.

It’s I guess more of a problem with the storage, but I haven’t found the actual reason, only what observations.

Edit: It might also be one or more apps running in the background. Things like Skype, etc.

some nand hardware have garbage controllers that hangs when processing discards when deleting files

that however is unrelated to the issue of inability to multitask due to lack of ram

Does Android also has swap space? Because that might explain the sluggish performance when free RAM is running low.

@littletijn
Android typically uses zram, where the swap is in RAM but gets compressed. It is quite efficient and typically achieves a 3:1 ratio.
Android generally does not swap to disk.

Hey @SkewedZeppelin,

thanks for your help with my free RAM issue and the link to the helpful FAQ. I only realized later that you’re the dev behind DivestOS and that DivestOS is indeed available for FP3! I read up on DivestOS in Kuketz-Blog (in German only) and it sounds great! I think will switch to DivestOS soon and will happily contribute via LiberaPay. Thanks for your support and your work on DivestOS and the FLOSS Android ecosystem! :pray:

1 Like