logo

Why does Android OS use so much RAM?


“Free memory is wasted memory”. This is what Android says. Free RAM isn't always a good thing, efficient use of RAM is. And Android operating system is quite efficient in managing RAM.

The main reason why you won't see much free RAM on Android devices is because when you stop using an app, and also it's not running a background service, Android still keep it alive in the RAM, though it cannot perform any task really. This is called “Cached” state of an app. In this state its use of CPU, network and other resources is restricted (using CGroups). But keeping it loaded in RAM serves a purpose: resume the app quickly when you open it the next time.

Let's have a look at RAM and swap breakdown using WhatsRunning:

Android RAM usage by cached apps

As you can see above, almost 13% of RAM and 6% of swap is used by the cached apps. But this amount is sparable and should be considered Free. If there are many cached apps and you open an app which needs more RAM, Android's Low Memory Killer kills one or more of the cached apps. Whcih app to kill first is determined by many factors including its age and the amount of RAM it's using.

This behavior is contradictory to PCs. On Windows or Linux when you close a program, its native process is killed and RAM is freed. But Android makes use of free RAM to improve device performance and user experience. It also conserves some power because starting an app from zero whenever you open it is a more resource-hungry process than resuming it from RAM.


Related:

Comments