Wednesday, 25 January 2012

Scarce resources 1 - Memory

There are three resources - internal memory, battery-life and cash - which, to varying extents, most smartphone users try to conserve. I am pretty stingy about all three.

When choosing and using mobile apps, there is almost always a trade-off between utility - the additional functionality, time-saving, or simple pleasure that I expect an app to bring me - and the holy trinity of memory, battery and hard-earned cash.

My HTC Desire is now nearly two years old. It's a great smartphone, but it has only 1GB of internal memory, divided more or less evenly between ROM (app storage) and RAM (current processes). That might sound like a lot of memory, but a significant slice of both ROM and RAM is taken up by the Android operating system itself, and by the various components of the HTC Sense overlay. Even when these are not using RAM memory they take up valuable ROM space, since they cannot be uninstalled. The amount of memory actually available for apps installed from the Android Market or elsewhere is therefore a real constraint. I don't monitor the phone's memory usage closely, but I do know that when the Available space in Internal phone storage falls below 20MB (below, left) then loading or switching between apps begins to slow down. Around the same time, I may start to receive 'Low on space' warnings in the notification bar.

Getting a bit low on available memory (left). If you really must, you can 'Force stop' an app (right), but it's better not to.

In fact, one of the Android operating system's great strengths is its efficient management of device memory. You'll find numerous 'task killer' apps in the Android Market which claim to improve speed and battery life by enabling you to close down apps when you are no longer using them. Don't be taken in. First, leaving Android itself to close apps when the memory they are using is needed by another process produces better results. Second, if you ever do need to shut down (or 'Force close') a rogue app, there's a perfectly good way to do this built right into the operating system. From the homescreen menu, choose Settings / Applications, then Manage applications, then choose the target application and tap on Force stop, as in the screenshot on the right, above. (These instructions are valid for Android 2.2, Froyo.) I have almost never had to do this. For anyone used to Windows computing, Android has a near-miraculous ability to recover gracefully from traumas.

So far, I have only talked about 'internal' storage space. The limited amount of this type of memory available on my HTC Desire makes me very careful about the apps I choose to install. Every app on the phone really has to justify the precious space it takes up. And if I am trying to decide between two apps offering similar functions, then I always tend to favour the one with the smaller installed size.

However, my phone also has plenty of 'external' storage space, with a 16GB microSD memory card fitted. This is where I store the music, photos and documents that I want to be accessible even when I don't have an internet connection. Apps use the SD card to store their data. But it is also possible to move large chunks of most apps to the SD card. This reduces their footprint in internal memory, making space for additional apps. Later versions of Android allow you to move apps to the SD card by default when you install them. But if, like me, you are still on Android 2.2 (Froyo) it is well worth going through all your applications and moving those that allow it to the SD card, if have not already done so. From the homescreen menu, choose Settings / Applications, then Manage applications, then choose the target application and tap on Move to SD card, if available. (If the app does not allow it, the button will be greyed out.)

One word of warning before you starting moving apps to the SD card. Homescreen widgets cannot run from the SD card. For this reason, most apps with widgets do not enable the 'Move to SD card' option, but some do. If you move such an app to the SD card you'll almost certainly find that its widget no longer works. If this happens, move the app back to the phone. You will probably then need to reboot the device by powering it down and powering it up again to get the widget to work.

My final memory management tip is to clear out your apps' caches from time to time. Most apps store data of various kinds, and this should not normally be cleared, as it probably includes all your settings. However, many apps also create temporary caches which can grow quite large over time. (The different buttons for clearing data and clearing the cache can be clearly seen on the right-hand screenshot, above.) If you encounter memory shortages, go into Settings / Applications from the homescreen menu, select Manage applications, and press the menu button to sort your apps by size. Go through the ten largest apps one at a time and clear their caches. Browsers in particular rapidly build up large caches. My preferred mobile browser, Dolphin HD, offers options to clear these caches from within its own settings menu - clearing the HTML5 cache may reclaim one or two precious megabytes of space.

To summarise, I recommend three simple strategies for conserving memory on your Android smartphone:
  1. Be highly selective in your choice of apps. Avoid duplication and choose small apps where possible.
  2. Move as many apps as you can to the SD card.
  3. Periodically clear the caches of your most memory-intensive apps.

Next post: Text entry