How to Manage Services in Android OS
To manage services in Android OS(this is Android 2.2, by the way, your screen may look a little different), you press the menu key (along the bottom of phone), which will pop up a menu, and choose "settings".
From Settings choose "Applications".
From Applications choose "Running Services".
Introduction
Android phones are wonderful little devices, capable of wide variety of functions due to its openness, but a lot of the problems comes from a lack of understanding of the Android OS. Here we will dig into the guts of Android OS, clear up some misconceptions, and figure out how to make your phone snappy again. There are right ways and wrong ways to do that.
Due to the way memory is managed in the Android OS, and the way Android apps are structured, the more apps you load, the less memory is available to actually run the apps, and the less memory is available, the slower the phone will run, as the phone must spend more time swapping apps in and out of the little working memory available. This affects both battery life and performance. (This is presented in VERY general terms, and is not meant to be a fully technical explanation. That comes later.)
Due to the way memory is managed in the Android OS, and the way Android apps are structured, the more apps you load, the less memory is available to actually run the apps, and the less memory is available, the slower the phone will run, as the phone must spend more time swapping apps in and out of the little working memory available. This affects both battery life and performance. (This is presented in VERY general terms, and is not meant to be a fully technical explanation. That comes later.)
The problem shows itself in at least three ways:
Symptom 1: You download an updated app and the download stops for apparently no reason
Diagnosis: The "downloading service" was shuffled out by the system, killing the download.
Go the the "services screen". (see sidebar) Does the "download service" says "restarting" to the right? That means It was indeed stopped by the system to give the memory to some other apps.
Symptom 2: Apps used to load from the launcher instantly now takes several seconds. Screens transitions are slow as heck. Loading a new supposedly "fast" launcher did not help.
Diagnosis: System is busy shuffling various activities and services in and out of memory.
Does lot of different services show "restarting"? Do the some of the services shows very short "active life"? (exception: you just started the related app only recently).
Symptom 3: Your phone used to last most of a day but now it won't last past lunch without a charge
Diagnosis: You have all sorts of services in the background using battery power here and there
If you go into the battery usage screen (settings / About Phone / Battery Usage) and you see a very long list of apps all taking a few bits and pieces of power (a few percentage here, a few percentage there), you have too many apps loaded, and they are all sucking up a little power, and all those bits and pieces add up.
All these problems can be traced back to a single cause: too many apps in too little memory. However, as the memory in Android phones are not expandable (unless you trade up to one with more memory), you can only deal with the problem by remove apps to make more memory available. But first, let us dig into the guts of Android OS and learn how Android OS manages memory, and how freeing up memory will make your phone more responsive and less buggy overall.
Symptom 1: You download an updated app and the download stops for apparently no reason
Diagnosis: The "downloading service" was shuffled out by the system, killing the download.
Go the the "services screen". (see sidebar) Does the "download service" says "restarting" to the right? That means It was indeed stopped by the system to give the memory to some other apps.
Symptom 2: Apps used to load from the launcher instantly now takes several seconds. Screens transitions are slow as heck. Loading a new supposedly "fast" launcher did not help.
Diagnosis: System is busy shuffling various activities and services in and out of memory.
Does lot of different services show "restarting"? Do the some of the services shows very short "active life"? (exception: you just started the related app only recently).
Symptom 3: Your phone used to last most of a day but now it won't last past lunch without a charge
Diagnosis: You have all sorts of services in the background using battery power here and there
If you go into the battery usage screen (settings / About Phone / Battery Usage) and you see a very long list of apps all taking a few bits and pieces of power (a few percentage here, a few percentage there), you have too many apps loaded, and they are all sucking up a little power, and all those bits and pieces add up.
All these problems can be traced back to a single cause: too many apps in too little memory. However, as the memory in Android phones are not expandable (unless you trade up to one with more memory), you can only deal with the problem by remove apps to make more memory available. But first, let us dig into the guts of Android OS and learn how Android OS manages memory, and how freeing up memory will make your phone more responsive and less buggy overall.
How Android OS Really Manages Memory
The Android OS memory management is a complicated subject, and is quite technical. Here's an abbreviated version.
Android OS roughly groups all apps into 6 groups, with priority from highest to lowest:
Foreground app: you see this app on screen, currently running, but also includes the system itself and "phone"
Visible app: the app is running and visible, but due to multi-tasking or such is not currently "on top"
Secondary server: services that stay in background and apps such as Launcher (or other home replacements). Most services go here, like music player, clock updater, background sync, and so on, that's not built into the OS.
Hidden Application: apps not visible, but still running in the background
Content Provider: process that provides content to the foreground, such as "contacts content provider", "calendar content provider", and so on. May also known as "storage".
Empty App: the app is in standby, not being used, but is still in memory
Within each 'group' the system assigns a "priority" number based on how recently the app was accessed, with assumption that a most recently access program should be kept, and the oldest will be out of luck.
When Android OS runs out of free memory and needs to load a new app, it starts killing apps in Empty App group, oldest first. if that's not enough, it then starts killing apps in the Content Provider Group, and it keeps going up groups until it has finally freed up enough memory to load the app and all related processes (such as services).
NOTE: Having a constant "notification" in the notification area makes the program "visible app" instead of "hidden app", thus making it less likely to be killed by the system to make room for other apps.
Most of the problems occur when the system tries to make room by killing "secondary server" processes that are needed.
Android OS roughly groups all apps into 6 groups, with priority from highest to lowest:
Foreground app: you see this app on screen, currently running, but also includes the system itself and "phone"
Visible app: the app is running and visible, but due to multi-tasking or such is not currently "on top"
Secondary server: services that stay in background and apps such as Launcher (or other home replacements). Most services go here, like music player, clock updater, background sync, and so on, that's not built into the OS.
Hidden Application: apps not visible, but still running in the background
Content Provider: process that provides content to the foreground, such as "contacts content provider", "calendar content provider", and so on. May also known as "storage".
Empty App: the app is in standby, not being used, but is still in memory
Within each 'group' the system assigns a "priority" number based on how recently the app was accessed, with assumption that a most recently access program should be kept, and the oldest will be out of luck.
When Android OS runs out of free memory and needs to load a new app, it starts killing apps in Empty App group, oldest first. if that's not enough, it then starts killing apps in the Content Provider Group, and it keeps going up groups until it has finally freed up enough memory to load the app and all related processes (such as services).
NOTE: Having a constant "notification" in the notification area makes the program "visible app" instead of "hidden app", thus making it less likely to be killed by the system to make room for other apps.
Most of the problems occur when the system tries to make room by killing "secondary server" processes that are needed.
Never Enough Memory
Android OS has THREE main pools of memory: RAM (for running programs), app storage (for storing programs that will be ran) and finally, SD card (for storing data like music, photos, and secondary storage). (NOTE: Some phones have "internal" SD card and external SD card, and they are known as /sdcard and /sdcard-ext respectively.)
RAM management is very complicated because Android OS is based on a Linux kernel (read: heart) and even seasoned Linux developer will tell you it is virtually incomprehensible. After extensive experimentation, it is found that the hardware itself (i.e. the PHONE) will take 32MB or so even before the Android OS loads. Then the fixed components like "system" (acore, phone, gapps, system...) will take up about 65-80MB. That's about 100-128 MB gone, without a single actual app being loaded.
Then you load the launcher itself, which uses anywhere like 8-30 MB.
NOW the individual apps load, except it's not that simple. Many apps have several components, the frontend (user interface) called "process", and the backend ("services"). Due to the way the apps work under the Android OS they usually take up at least 3 MB of RAM even though the app itself appears to be only a few hundred KB in size. Some can use a lot more RAM.
Check the Services screen. You will see each service takes up 2-5 (or more) MB, some may take 15 or more. That does not leave much for the apps, esp. when the "services" are often loaded automatically. The more apps you load (or start automatically), the less is available to the system.
Every widget you place on the screen is backed up by a service. If you have 5 widgets on screen, that's another 20 MB or so gone. Subtract another 10-20 for live wallpaper (depending on complexity), and your consumed RAM is up to 160+ MB, and that's BEFORE you actually run any programs!
The early Android phones are extremely RAM deficient. Original Google phone, the T-Mobile G1 has only 192MB internal storage, and original Motorola Droid has only 256MB. With 16)+ MB used up before any apps, this leaves almost NOTHING for the actual apps. The later Android phones like Samsung Galaxy S series expanded that to 512MB, and some of the latest phones are up to 768MB or even 1 GB in RAM. So keeping more internal memory free is easier on those phones.
So you're probably wondering, if there's only like 80-90MB of RAM available, how can you load like 100-200 MB of apps? What happens is the phone try to fit in more apps than the memory would allow, so it kills off "lower priority" apps and services in order to make room for other apps. However, those apps may request the system to load itself back into memory, so you have a CPU trying to fit X+Y programs into space that can only fit X, by time-sharing... Load apps to do something, then swap those out of memory and swap some others back in. This constant swap process is handled all in the background.
NOTE: The way system decides what to kill and what to load is rather complicated, so see the sidebar.
So the lesson learned is simple: load LESS stuff into RAM. And how do you load less stuff into RAM? Load less apps. Really, it is that simple.
Your App storage is important, but not as important as RAM. My phone shows I've used up 176MB of my 256MB of app storage just for apps and their cache and data. Each app you load also needs some space to store working data. So a small app of only a few hundred KB can be using several megabytes of data, both working data and cache. Web browser apps are notorious for keeping cache of several megabytes when it is only a few hundred KB in size.
To see how much app storage you got left, go to menu / Settings / Sd Card and Phone Storage. At the very bottom, under "internal Phone stroage", it'll tell you how much it has left.
So what can we do about this? Here are 6 normal tips and 4 advance tips.
So what can we do about this? Here are 6 normal tips and 4 advance tips.
Free Up More Memory With 6 Easy Tips
Tip 1: Uninstall the apps you rarely use
It is obvious, but it's still true: the less program you load, the more responsive the phone will be, because there are a LOT of free memory available. More memory will be available to the phone to actually RUN the programs.
If you want to save the app, use something like AppManager, AppMonster, or Titanium Backup to archive the apps you want to keep around to SD card. Or just redownload them when you need them.
Figure out which apps are taking up the most space by going to menu / Settings / Applications / Manage Applications / menu / sort by size (default is sort by alpha A-Z)
(You can also sort by size in AppBrain, but that's the "total size", not the "internal storage size", which is not that useful)
It is obvious, but it's still true: the less program you load, the more responsive the phone will be, because there are a LOT of free memory available. More memory will be available to the phone to actually RUN the programs.
If you want to save the app, use something like AppManager, AppMonster, or Titanium Backup to archive the apps you want to keep around to SD card. Or just redownload them when you need them.
Figure out which apps are taking up the most space by going to menu / Settings / Applications / Manage Applications / menu / sort by size (default is sort by alpha A-Z)
(You can also sort by size in AppBrain, but that's the "total size", not the "internal storage size", which is not that useful)
Also see Tip #6: Do NOT use a Task Killer.
Tip 2: Move apps back from SD Card... if possible
(Yes, I know I used to recommend the exact opposite)
Apps are really meant to be run from internal storage. Move2SD is a neat feature, but SD card is still not as fast as internal storage (unless you have a Class 10 or faster). For the apps you use often, move them BACK INTO phone. They'll actually run faster.
Tip 3: Use only the bare minimum number of widgets
Each widget loads a "service" or two to keep itself updated, and each service is 2-4 MB of space used, even if the widget itself is only like 50KB in size.
Look at the Services Screen yourself: How much is that pretty clock widget taking up? Probably 2-4 MB. Add another one for the music player, another one for the podcast player, another one for this, another one for that... They all add up.
Tip 4: Use a Static Wallpaper
Even a simple Live Wallpaper will take 2 MB or so of memory. Complicated ones may take up to 20MB. And that thing is running ALL THE TIME. It even sucks up CPU power (and battery). Thus, just use a static wallpaper.
Tip 5: Occasionally, Manually Kill Unnecessary Services
Seems every app nowadays comes with a service... and uses several MB of internal memory, even when they are NOT running.
Google Maps have a "Places" service that sometimes loads even when Maps is NOT loaded. Youtube sometimes loads a "widget service" even when it's not running and have no widgets on screen. When you exit an app, the associated services are not always stopped with it.
Kill them manually (see "Running Services" sidebar above), tap any service to kill it. Make their space available to other apps. In fact, if you rarely use that app, uninstall it altogether. (See Tip #1)
Tip 6: Do NOT Use Task Killers on Automatic or Schedule
Advanced Task Killer and similar apps may interfere with the built-in memory management. The memory they free up is only temporary and may include running apps, which will be reloaded by the system in moments.
The best way NOT to overburden the system is to load less apps in the first place
You can have one loaded, but turn off any auto-kill or schedule-kill functions.Advanced Task Killer for Froyo by ReChild is what I use, but only very occasionally, and you can just go into services and kill individual services.
You can have one loaded, but turn off any auto-kill or schedule-kill functions.Advanced Task Killer for Froyo by ReChild is what I use, but only very occasionally, and you can just go into services and kill individual services.
For more information on why NOT to use Task Killers, see my other hub: Android OS Task Killers.
4 Advanced Tips for Rooted Phones
The following advanced tips all require rooting the phone, which means you gain "superuser" status that allows you to read/write all portions of the phone, even the "system" sections, which normal users don't have access to. Not all phones can be rooted, and rooting your phone MAY void your warranty. You do so at your own risk, and there are guides out there on how to root your phone. If the 6 tips above are somehow not enough to help you, try the four tips below.
Advanced Tip 1: Use AutoStarts or Autorun Manager to disable automatic startup of programs
REQUIRES ROOT!
The good apps can be set to NOT run at startup. The not-so-good ones just start without giving you a choice.
Use AutoStarts (paid app) or Autorun manager (free) and disable the startups of certain apps. Not all apps need to stay on all the time. AutoStarts can also prevent apps from being started by certain system events, such as "bluetooth on". For example, if you have an app that's supposed to be triggered by the camera button, but isn't, the only way you'll diagnose it is run AutoStarts and see which app is hooked into that event and disable it.
Advanced Tip 1: Use AutoStarts or Autorun Manager to disable automatic startup of programs
REQUIRES ROOT!
The good apps can be set to NOT run at startup. The not-so-good ones just start without giving you a choice.
Use AutoStarts (paid app) or Autorun manager (free) and disable the startups of certain apps. Not all apps need to stay on all the time. AutoStarts can also prevent apps from being started by certain system events, such as "bluetooth on". For example, if you have an app that's supposed to be triggered by the camera button, but isn't, the only way you'll diagnose it is run AutoStarts and see which app is hooked into that event and disable it.
There are a lot of programs that claims to stop "autorun" or "autostart", but this is the original, and it really does work. The ones that don't require root only works about half of the time.
Advanced Tip 2: Use Auto Memory Manager or AutoKiller to tweak settings
REQUIRES ROOT!
Use Auto Memory Manager or AutoKiller to tweak the built-in memory manager to be more aggressive or just somewhat more active (i.e. "mild") than the default setting, which is VERY conservative.
This means you don't need to mess with a task killer at all (except for certain instances). I have mine set on "mild".
Advanced Tip 3: Load an Overclocked Kernel
REQUIRES ROOT!
Load an overclocking kernel so you can overclock the CPU in your Android phone. The OMAP CPU in the original Moto Droid is designed for 600 MHz, but is clocked at only 550 MHz for better battery life. However, it can be easily overclocked to 800 MHz without modification, and perhaps even 1.2 or 1.25 GHz (depending on how lucky you are) by loading a new kernel.
Keep in mind there are dozens of different alternate kernels out there and they are written for a specific phone model and specific clock speed. You will need to know how to boot into "recovery mode" in case your kernel experimentation did not work out.
Advanced Tip 3: Load an Overclocked Kernel
REQUIRES ROOT!
Load an overclocking kernel so you can overclock the CPU in your Android phone. The OMAP CPU in the original Moto Droid is designed for 600 MHz, but is clocked at only 550 MHz for better battery life. However, it can be easily overclocked to 800 MHz without modification, and perhaps even 1.2 or 1.25 GHz (depending on how lucky you are) by loading a new kernel.
Keep in mind there are dozens of different alternate kernels out there and they are written for a specific phone model and specific clock speed. You will need to know how to boot into "recovery mode" in case your kernel experimentation did not work out.
I have mine set to 1.1 GHz and it never had any problems.
Advanced Tip 4: Load a new Custom ROM altogether
REQUIRES ROOT!
Advanced Tip 4: Load a new Custom ROM altogether
REQUIRES ROOT!
People love Customs ROMs, and many are noticeably faster (though a lot of it is from completely wiping out all the apps). Still, it is a valid way to "start over" with your phone.
For almost every model of Android phone (at least the popular ones) there are custom ROM developers making custom ROMs for it. The original Motorola Droid, i.e. OG Droid, had a dozen or more custom ROMs, the best known of which: Cyanogen Mod (which gradually expanded to support over a dozen different phones). However, there's also Liquid, Alfonso, MIUI, and many more.
Buy ROM manager and it will make swapping ROMs virtually painless. Remember though, you do need to be rooted.
Conclusion
Memory Management in Android Phone is a bit complicated, and the way memory was designed makes it difficult to cope with shortages. I hope the tips help you make your phone fast again.
Also See....
- [Lifehacker] How to Speed Up Your Old, Sluggish Android Device
Whether you're resisting the temptation to upgrade to newer, faster hardware, or a year's worth of use has made your Android phone feel slow and laggy, here are some ways to make your older phone run a bit smoother. - Eight Things You Should Try on an Android Phone
Android phones can do a lot, but how about exercise buddy? Personal finance? Find 8 uses you haven't thought of with your Android smartphone. - Review of Juice Defender and 18 other battery life e...
Review of battery saving apps and solutions for the Motorola Droid and Android 2.x devices. How do you extend battery life of your phone? What is worth trying and what would actually be useful? Find out here. - Android Browser vs. Dolphin HD, Opera Mini, xScope, ...
Android web browser... Browser, Dolphin HD, Opera 5 Mini, xScope, or Skyfire? How about Firefox/Fennec and other browsers? Find out which is the best choice on Android device. - Review and Comparison of 11 free camera apps for Mot...
The default Camera app in the Droid is a bit lacking in features, and there are many free replacements that do a lot better. Which ones are worth your download? Find out here.
Android App Quick Review Updates
- Upgrading Bionic to Ice Cream SandwichEnglish: Picture of the front of the DROID BIONIC by Motorola (Photo credit: Wikipedia)For some people, all they need is to wait for the OTA (over the air) updates, and voila, it's done. Not me. I...
- AAQR: X-Plane 9 (flight sim)X-Plane 9, one of the most impressive flight sims, is now FREE on Android (it used to cost $20!) X-Plane is one of the sims where it actually calculate the aerodynamic forces of the air against the...
- AAQR: Indestructible (game)Another "freemium" game from GLU mobile, this game is full of microtransactions that entices you to buy new vehicle skins, new weapons, and so on and so forth. However, this GLU game offers full...
- AAQR: Battleships Pro (game)Ever wondered why haven't people made a game where you can play Battleship against AI player? They have! This one has a few tricks, like "bombers", scatter shots, as well as 3 different AI...
- AAQR: Modern War (game)Modern War is basically a clone of "Advanced War" on the handheld consoles, where you move units, capture points, build more units, and destroy all enemies, in turn-based hex-grid combat. Different...
Tidak ada komentar:
Posting Komentar