Question How does Android Memory Management work ?

jack63ss

New member
Jul 29, 2021
4
1
3
Visit site
So I have a couple of questions about Memory Management in an Android OS, in my case Fire OS. I've read a number of articles about how it is "supposed" to work, but I have some questions about how it is normally implemented.

First, when you "stop using" an app by swiping it in some direction, is the OS supposed to Destroy the app and release the memory back to the heap ? I ask as from what I have seen with my Amazon Fire, it does not work that way. The app simply becomes a "Background Process", ie. an Activity that is Hidden, and over time memory gets full and the system starts running slower.

I see this all the time, and when my tablet gets to the painfully slow point I run an app to "Force Stop" the apps I am no longer using, and when I run the app it can show I have 12-15 "apps" still running on my system. As soon as I stop them the system immediately starts running faster. So I understand the Hidden concept, but if I want to exit an app, ie. stop using it and release the memory, does the OS not allow me to do that ?

My second question is, what is setting the Max number of Background processes supposed to do ? On an Fire OS system it seems to do nothing. The OS just keeps stuffing things in memory until it runs out, getting slower and slower as time goes on.

Last, why do some Android app developers build apps that basically do not restore active state when they go from Hidden back to Active ? Instead they restart the app. Are they kidding ?

So I'm sorry, but I spend a large portion of my career working in the OS space, mostly Unix/Linux vatiants, and what I see with Fire OS confuses me as it makes no sense. So I figured I would ask for some clarification.

thanks
Jack
 

Mooncatt

Ambassador
Feb 23, 2011
10,759
321
83
Visit site
Being that Amazon Fire is not directly an Android OS, but a customized Android based OS, some of your issues may simply be due to that customization.

In general for Android, the OS wants to keep memory full with background apps to increase battery life. The memory uses the same energy regardless of what's stored in it, so maintaining apps in the background reduces the amount of processing power needed to initialize apps from scratch. While in the background, those apps are supposed to be dormant, not using any processing power until called upon (either by opening them or apps meant to show you notifications). The OS monitors your app usage to help determine which apps to keep in memory. I.e. Your most frequently used apps would get priority. When you swipe an app away, it may remain in memory. If you actually force close it from the app manager, it could get re-initialized in the background by the OS, or another app could take its place. There is nothing you can do to prevent this, and attempts to do so with memory management apps only make the problem worse because they fight against the OS design.

From what I've seen, Amazon Fire tablets tend to be low spec compared to their main Android counterparts, especially when it comes to memory. If you have low memory, but use a lot of different apps, you can run into issues like you're seeing now. Since they don't seem to like giving the exact specs of their processors, it wouldn't surprise me if they are cheap, relatively slow processors that are more sensitive to this sort of issue.
 

Trending Posts

Forum statistics

Threads
943,204
Messages
6,917,795
Members
3,158,877
Latest member
TSFDeymos