• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

The Restarting State

franhound

Member
FjRZvk6.jpg


So, I always notice that background processes and services in my phone always end up being in this state. And they stay like that until I reboot. It seems like they've been closed, then they're needed again so they decided to start up again, but failed in doing so. Now they're stuck in this "restarting" state in which they seem to spike the CPU terribly; cause lag.

Is there any way to prevent this from happening? Or, alternatively, do something about it when it happens again? Like, some tweaks in the settings or some third party applications? I don't wanna reboot too often.

And, no, I don't use task killers (I know you'll ask about this).
 
your memory is more than 85% used up with only 23MB remaining. the apps are stuck in 'restarting' because Android is probably killing them over and over to free up RAM for another program that is still running. on lower end devices running 2.3.x Android versions, this is a known issue after enough apps are installed. each app you install likely runs in the background and the more apps, the more RAM used. Android cannot free up enough to run them all hence the lag and 'restarting' status. by the looks of it, your device only has 512MB RAM. too many apps are fighting over it. Facebook, Monster Island, OfficeSuite (preinstalled bloatware) and Apex Launcher are big memory hogs. since the launcher is also restarting, i'm guessing you get redraw issues where the launcher doens't appear right away for a few seconds when you press 'home' or back out of an app.
 
your memory is more than 85% used up with only 23MB remaining. the apps are stuck in 'restarting' because Android is probably killing them over and over to free up RAM for another program that is still running. on lower end devices running 2.3.x Android versions, this is a known issue after enough apps are installed. each app you install likely runs in the background and the more apps, the more RAM used. Android cannot free up enough to run them all hence the lag and 'restarting' status. by the looks of it, your device only has 512MB RAM. too many apps are fighting over it. Facebook, Monster Island, OfficeSuite (preinstalled bloatware) and Apex Launcher are big memory hogs. since the launcher is also restarting, i'm guessing you get redraw issues where the launcher doens't appear right away for a few seconds when you press 'home' or back out of an app.

Yeah, I get a lot of redraws. Strange thing is that the device runs perfectly after a reboot, then starts lagging after running continuously for a day or two.

So, what do you recommend other than uninstalling a lot of applications?
 
Well you can edit the settings of some of the apps to make them not load themselves. Or, if this is a new phone, you'll have to stick through this until Android learns your usage patterns enough to know which apps to start. Or choose apps that don't need to run in the background. Although I find it weird why OfficeSuite is loading up on you if you aren't using it. I use Kingsoft and it doesn't load up. Did you exit properly?
 
Well you can edit the settings of some of the apps to make them not load themselves. Or, if this is a new phone, you'll have to stick through this until Android learns your usage patterns enough to know which apps to start. Or choose apps that don't need to run in the background. Although I find it weird why OfficeSuite is loading up on you if you aren't using it. I use Kingsoft and it doesn't load up. Did you exit properly?

Even if I didn't use OfficeSuite earlier, it would still be running there. Hmm.
 
if you had root, you could edit some of the VM heap sizes and minfree values to keep the restarting to a minimum, but the device is still a bit short on RAM to fit them all. it gets worse when it's got less than 50MB remaining but even with 100+ depending on the apps and their individual footprints it may be less laggy but some apps would restart.

the reason your phone is faster after a reboot is because nothing is running yet. when the apps start fighting over which app gets which amount of insufficient memory, it will start lagging again. there's really nothing you can do except to be aware of how much RAM apps can use and how many apps you can install and share with them all. i had a lower end phone awhile back this year, and it only had 256MB RAM. it took ten apps before it started being unstable, slow, and laggy. i had to hack it to death via root just to make it load a max of 5-8 apps, often those i used every day. the rest wouldn't start up unless i manually tapped their icons as i had adjusted Android's built-in task manager to only allow x amount of RAM to be used at one time. with lower end devices, Android often makes a mistake when it tries to clear out memory on its own. third-party launchers seem to be the first to go, and causing the redraws, even some 'app not responding' dialogs, because third-party launchers don't ever get a higher priority even when you use them often, which is odd but true. Go Launcher and ADW for example are set at a priority level 6, which means when Android needs extra memory for some app (such as Facebook) it will kill the launcher before anything else. you won't notice that until you back out and sit staring at a blank screen for a bit.

The worst case scenario is when Android simply cannot allocate enough memory and sends a call to the kernel to 'panic' which means it will reboot the phone by itself, usually leaving some type of log with the warning being 'Panic occurred: out of memory'. this is known as an 'OOM panic'. again, if rooted, you can tell Android to not do that when such a condition occurs, and the condition often does if you use tons of apps, but the result is often a dead-freeze or another more important part of the OS crashing, like statusbar.apk.

Another root trick and one i found most successful in keeping even the oldest device fluid, was to disable certain 'background receivers' inside of individual apps. a 'receiver' is a part of an app that normally wakes the app up and makes it run in background mode to, say, receive email notifications, notify you of Facebook messages, or Play Store letting you know certain apps have updates available. another type of reciever is a 'download receiver' and Play Store uses this one to download updates if you got auto-update apps enabled. these recievers will make it appear that an app is running, and when it exits, and another receiver wakes up, the app will appear to be 'restarting'. that number where it says 'x background services' is often a reciever.

disabling the receivers you don't really need (say you can often open the Facebook app to see anything new, vs. allowing Facebook to place icons in your status bar) can free up just enough RAM to keep things fluid without killing the app, and helps immensely in lower end products. keep in mind however, if you did this, you may lose some functions of the apps. if you for example disable the reciever for Play Store's 'recommended apps for you' widget, you may get a blank space where apps they think you'll like would display when you open Play Store.
 
if you had root, you could edit some of the VM heap sizes and minfree values to keep the restarting to a minimum, but the device is still a bit short on RAM to fit them all. it gets worse when it's got less than 50MB remaining but even with 100+ depending on the apps and their individual footprints it may be less laggy but some apps would restart.

the reason your phone is faster after a reboot is because nothing is running yet. when the apps start fighting over which app gets which amount of insufficient memory, it will start lagging again. there's really nothing you can do except to be aware of how much RAM apps can use and how many apps you can install and share with them all. i had a lower end phone awhile back this year, and it only had 256MB RAM. it took ten apps before it started being unstable, slow, and laggy. i had to hack it to death via root just to make it load a max of 5-8 apps, often those i used every day. the rest wouldn't start up unless i manually tapped their icons as i had adjusted Android's built-in task manager to only allow x amount of RAM to be used at one time. with lower end devices, Android often makes a mistake when it tries to clear out memory on its own. third-party launchers seem to be the first to go, and causing the redraws, even some 'app not responding' dialogs, because third-party launchers don't ever get a higher priority even when you use them often, which is odd but true. Go Launcher and ADW for example are set at a priority level 6, which means when Android needs extra memory for some app (such as Facebook) it will kill the launcher before anything else. you won't notice that until you back out and sit staring at a blank screen for a bit.

The worst case scenario is when Android simply cannot allocate enough memory and sends a call to the kernel to 'panic' which means it will reboot the phone by itself, usually leaving some type of log with the warning being 'Panic occurred: out of memory'. this is known as an 'OOM panic'. again, if rooted, you can tell Android to not do that when such a condition occurs, and the condition often does if you use tons of apps, but the result is often a dead-freeze or another more important part of the OS crashing, like statusbar.apk.

Another root trick and one i found most successful in keeping even the oldest device fluid, was to disable certain 'background receivers' inside of individual apps. a 'receiver' is a part of an app that normally wakes the app up and makes it run in background mode to, say, receive email notifications, notify you of Facebook messages, or Play Store letting you know certain apps have updates available. another type of reciever is a 'download receiver' and Play Store uses this one to download updates if you got auto-update apps enabled. these recievers will make it appear that an app is running, and when it exits, and another receiver wakes up, the app will appear to be 'restarting'. that number where it says 'x background services' is often a reciever.

disabling the receivers you don't really need (say you can often open the Facebook app to see anything new, vs. allowing Facebook to place icons in your status bar) can free up just enough RAM to keep things fluid without killing the app, and helps immensely in lower end products. keep in mind however, if you did this, you may lose some functions of the apps. if you for example disable the reciever for Play Store's 'recommended apps for you' widget, you may get a blank space where apps they think you'll like would display when you open Play Store.

Thanks for the info. So, is there any way to set a certain amount of RAM to maintain in a non-rooted device? How about setting the priority for certain apps?
 
it think any type of method to manually close apps vs. letting Android do it would require root or a task killer, and i wouldn't recommend the latter. the best way to ensure an app closes down properly is to exit by hitting 'back' until you're back to the home screen, and not be so quick to hit 'home'. it takes more steps but 'home' is basically the minimize button. back often exits everything but the background receivers (as in the apps will still show up in the running list) if the app is coded properly. let me say that Facebook for Android truly sucks compared with its iOS cousin. i often prefer Friendcaster as an alternative especially since it's far more tablet friendly.

I'd personally uninstall the Facebook app and use the browser and go to m.facebook.com. it looks exactly like the app and will save you a ton of memory for other apps. Facebook for Android is a huge memory hog.
 
it think any type of method to manually close apps vs. letting Android do it would require root or a task killer, and i wouldn't recommend the latter. the best way to ensure an app closes down properly is to exit by hitting 'back' until you're back to the home screen, and not be so quick to hit 'home'. it takes more steps but 'home' is basically the minimize button. back often exits everything but the background receivers (as in the apps will still show up in the running list) if the app is coded properly. let me say that Facebook for Android truly sucks compared with its iOS cousin. i often prefer Friendcaster as an alternative especially since it's far more tablet friendly.

I'd personally uninstall the Facebook app and use the browser and go to m.facebook.com. it looks exactly like the app and will save you a ton of memory for other apps. Facebook for Android is a huge memory hog.

I usually exit by hitting the home button, then swiping the app off the multitasking window. Is that unhealthy?
 
I usually exit by hitting the home button, then swiping the app off the multitasking window. Is that unhealthy?

That means you're not actually exiting the app. Swiping it from multitaskingwindow does nothing. Take this example, get a music player active, or even YouTube playing in the background. Swipe it from multitasking and it will still be running, it won't stop. Because swiping from that view only removes it from history, it doesn't exit the app. It's still running in the background. That's probably why some of those apps are restarting, because the length of time you have them on without exiting, Android thinks that you use them a lot and keep on trying to load them.
 
That means you're not actually exiting the app. Swiping it from multitaskingwindow does nothing. Take this example, get a music player active, or even YouTube playing in the background. Swipe it from multitasking and it will still be running, it won't stop. Because swiping from that view only removes it from history, it doesn't exit the app. It's still running in the background. That's probably why some of those apps are restarting, because the length of time you have them on without exiting, Android thinks that you use them a lot and keep on trying to load them.

Even pressing back to leave the music player doesn't stop the song, though. But thanks for the info. It makes me think twice about my habit. I just find backing to exit is so much of a hassle.
 
not every app responds the same to the back button. as i said, it closes the foreground app but leaves background receivers active, meaning that you are closing the player's actual UI, but the music continues to play because the playback acts as a background service. if you hit home, not only are the background receivers active, the actual app interface is, as well, doubling the RAM demand.

many apps if you back out vs. hitting home even pop up a little dialog asking if you want to exit the app. most apps that are coded like that often shut completely down on such an action.

I own a Galaxy SIII. i often hit Home the same way i used to on an iPhone. but my phone has 1GB of RAM as well and i use maybe a handfull of apps each day. i never worry anymore. on a lower end device with 512 or less MB of RAM, this habit can cause lag. my phone uses around 500MB of RAM on a busy day, and often hovers around 450-350MB free overall. i never need to worry and i never get lag. in fact, i have my CPU underclocked to 486MHz because on average i don't need the extra speed unless i am playing a game. root has benefits. i noticed on some devices, the 'scaling' of the speed of a CPU often causes hiccups, often when it's constantly switching between low and high speeds, it can cause slight lags. having it set to a fixed speed has improved a lot across many of my devices.
 
not every app responds the same to the back button. as i said, it closes the foreground app but leaves background receivers active, meaning that you are closing the player's actual UI, but the music continues to play because the playback acts as a background service. if you hit home, not only are the background receivers active, the actual app interface is, as well, doubling the RAM demand.

many apps if you back out vs. hitting home even pop up a little dialog asking if you want to exit the app. most apps that are coded like that often shut completely down on such an action.

I own a Galaxy SIII. i often hit Home the same way i used to on an iPhone. but my phone has 1GB of RAM as well and i use maybe a handfull of apps each day. i never worry anymore. on a lower end device with 512 or less MB of RAM, this habit can cause lag. my phone uses around 500MB of RAM on a busy day, and often hovers around 450-350MB free overall. i never need to worry and i never get lag. in fact, i have my CPU underclocked to 486MHz because on average i don't need the extra speed unless i am playing a game. root has benefits. i noticed on some devices, the 'scaling' of the speed of a CPU often causes hiccups, often when it's constantly switching between low and high speeds, it can cause slight lags. having it set to a fixed speed has improved a lot across many of my devices.

Where's the free RAM is wasted RAM thing now?

Also, my phone has this CPU power saving mode option under the battery section in settings. Do you recommend turning it on? Does is it set the CPU speed to a fixed one, like you mentioned?
 
no, it just dims the screen and turns the speed very low and it still scales but at lower speeds. i have not noticed any real battery savings from it and it makes my phone lag a lot. i disabled it and later flashed a ROM that doesn't have the feature.

As for the 'Free RAM is Wasted RAM' mantra, it won't apply much to low end products with low amounts of RAM and too many apps trying to fight over it. it would apply more if you had six or five apps going, but install ten huge memory hogs like Facebook and pre-installed bloatware included you start having problems.
 
no, it just dims the screen and turns the speed very low and it still scales but at lower speeds. i have not noticed any real battery savings from it and it makes my phone lag a lot. i disabled it and later flashed a ROM that doesn't have the feature.

As for the 'Free RAM is Wasted RAM' mantra, it won't apply much to low end products with low amounts of RAM and too many apps trying to fight over it. it would apply more if you had six or five apps going, but install ten huge memory hogs like Facebook and pre-installed bloatware included you start having problems.

I see. What if I limit background processes to 4? Will that do any good?
 
if you run ICS and up you can try that, but that feature didn't exist until Android 4.0. what version you running?
 
Back
Top Bottom