Thursday, August 22, 2013

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".


Press
See all 4 photos Press "menu" key to bring up the menu, and pick Settings Once in Settings, pick
See all 4 photos Once in Settings, pick "Applications" Once in Applications, pick
See all 4 photos Once in Applications, pick "Running Services" And this is the
See all 4 photos And this is the "Services" screen. If any of the services says 'restarting' instead of an actual time, that service was pushed out of active memory.

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.)

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.

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.

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.

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)

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.

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.

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.

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!

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.


  • How To Make Android Faster: What Works, And What Doesn't -

    www.makeuseof.com/tag/android-faster-works

    Jul 27, 2012 Everyone wants their devices to run faster and scammers prey on that. Recently, a scam app named Android Defrag Pro popped up on Google Play. Android


  • Young Spirit 90: How to Make My / Your Slow and Slower Android ...

    youngspirit90.blogspot.com/2013/02/how-to-make-my-your-slow-and...

    Feb 22, 2013 How to Make My / Your Slow and Slower Android Phone Faster for Free (clean up memory and apps!)


  • How to optimize and speed up to make Android phone run faster ...

    www.techmostwanted.com/guide/how-to-optimize-and-speed-up-to-make...

    And the older version of Android doesnt handle memory ... speed up to make Android phone run faster ... installing some apps, its slow already. is it ...


  • 5 Ways to Make Your Non-Rooted Android Phone Run Faster

    www.guidingtech.com/12231/ways-to-make-non-rooted-android-faster

    Your Android Phone Running Slow? Don't Want to Root it? Here are 5 Ways to Make Your Non-Rooted Android Phone Run Faster. ... Use Apps to Free Up the RAM.


  • how to make phone faster? - Android Forums

    androidforums.com Archived Phones Samsung Intercept (Sprint)Last updated: Mar 17, 2011 Last updated: Mar 17, 2011 9 posts 9 posts

    Is there a way to make it faster? I like the android OS but ... Unbearably slow? It's not the fastest phone ... Set it up to kill all unnecessary apps hoggin up your ...


  • Why Is Android OS Slow? eHow - eHow How to Videos,

    www.ehow.com Cell Phones & Accessories Smart Phones

    The Android phone operating system, just like any operating system, can slow down with excessive or improper use. If too many apps are running at the same time, the ...


  • Need for speed: iPhone 5 is up to TWICE as slow as android

    Rotten Apple? iPhone 5 is TWICE as slow as Android rivals, claims watchdogDaily Mail 4 days ago

    Rotten Apple? iPhone 5 is TWICE as slow as Android rivals, ... the faster the phone. ... costing up to 450 is bought sim free, ...

  • How To Make Slower Android Phone/Tablet Faster 10 Ways -

    www.nxttech.org/how-to-make-slower-android-phonetablet-faster-10-ways

    How To Make Slower Android Phone/Tablet Faster 10 ... one of these apps in the Play ... be minimal but you also have a clean tablet with more free memory.

  • How to Make My Your Slow and Slower Android Phone Faster for Free ...

    cheapbags62.iwannayou.com/2013/05/08/how-to-make-my-your-slow-and...

    Post navigation Previous Next How to Make My Your Slow and Slower Android Phone Faster for Free (clean up memory and apps!)_15

  • How to Maintain Your Android Phone TechHive

    www.techhive.com/article/258295/how_to_maintain_your_android_phone...

    Doing so will open up space on your phone for more music, ... Clean Out Your Memory Card. ... We've described how to root your Android phone countless times

  • iPhone 5 benchmarks: Slower than the Galaxy S3, faster than the ...

    www.extremetech.com/computing/136291-iphone

    ... the latest dual- and quad-core Android devices are just as fast, or faster. ... apps that make good use of four ... free to do what i please with my phone & not ...

  • Android

    www.android.comAndroid Market Get Apps What is Android 4.0 Platform Highlights

    All the tools and documentation you need to create Android apps. Google Play Find great apps, books, movies and music to enjoy on your device. ...

  • kschang on HubPages

    kschang.hubpages.com

    How to Make My / Your Slow and Slower Android Phone Faster for Free (clean up memory and apps!) 17 months ago. Your Android phone slowing down?

  • Inside Galaxy: How to Make Samsung Galaxy SIII Feel Faster

    inside-galaxy.blogspot.com/2013/03/how-to-make-samsung-galaxy-siii...

    The last thing you can do to make your phone run faster ... The conclusion is let your phone to manage their own memory and never clean up ... Android Market; Apps;

  • Slow Streaming Video Problems

    www.delete-computer-history.com/slow-streaming-video.html

    Experiencing slow streaming video problems and want to speed up your video streaming and buffering? Learn how to make streaming videos faster with these easy tips.

  • How to Speed Up Your Computer? 5 Tricks to Make your PC Faster

    teknowlodgy.com/tips-tricks/computing/how-to-speed-up-your...

    How to Speed Up Your Computer? 5 Tricks to Make your PC Faster ... Free-up memory space: Several disk clean-up ... Accessories Android Apple Apps

  • How to make your computer run faster - by Henry Case - Helium

    www.helium.com Hardware Computer Maintenance

    ... the slower your computer will get. Memory intensive software like photo and video ... Top free android apps for the ... How to set up voice mail on a Droid phone;

  • Sprint Community: iPhone 4S on 3G data network too slow to be

    community.sprint.com/baw/thread/78766

    Find help and tips on your Sprint phone. Keep up on the latest Sprint ... Android apps; Entertainment; Games ... Maybe I can cancel my contract for free because they ...

  • Cache Cleaner + - Android Apps and Tests - AndroidPIT

    www.androidpit.com/en/android/market/apps/app/com.isnowstudio...Rating: 4.5/5 3,177 ratings

    Cache Cleaner+ is a simple and easy to use android application cache cleaning tool. Whether your phone is running slower and slower, and more use of a battery; ...

0 comments:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!