May 17, 2012 9:09am
Update: HTC Canada has released an official statement on the matter:
“HTC is aware of some questions in the enthusiast community about how the HTC One X handles multitasking and memory management for background apps. We value the community’s input and are always looking for ways to enhance customers’ experience with our devices. That said, right now multitasking is operating normally according to our custom memory management specifications which balance core ICS features with a consistent HTC Sense experience.”
But over the past few days, HTC’s implementation of Android’s widely-lauded multitasking system has come into question. In addition to morphing the simple-yet-effective vertical orientation of Android 4.0’s default multitasking menu into a garish horizontal UX, they seem to have messed with the fundamental architecture of Android’s memory management.
Users have been reporting in droves that instead of saving the state of an open app, the One X is closing it in order to save memory. With 1GB of RAM this shouldn’t be happening, at least not until the fifth or sixth app in the chain. HTC claims, however, that the functionality is a normal part of its battery-saving Sense 4.0 infrastructure. Read on for more.
First, let’s have a brief lesson in how Android memory management works. There are five states and three priorities that apps can take, which influence that app’s interaction with the processor, RAM, and ultimately, the user. Though all of these processes are governed by Android’s Dalvik Virtual Machine, which itself is controlled by a low-level Linux kernel, let’s take a more (admittedly) simple approach.
Active - Active tasks are those in the foreground, presumably the app open in front of you. This takes the form of drawing CPU and GPU cycles to ensure that the open app responds instantly to your input. These apps are rarely closed by the system unless there is a kernel panic or critical RAM situation.
Visible/Started Services - Visible processes, or Services that require an “active” approach, take the form of background tasks that keeps an open socket to the network (such as email, SMS or anything that requires push notifications). These apps are occasionally closed if the foreground app, such as a game, needs a significant amount of RAM to function optimally.
Background/Empty Process - Background processes are the first to go when the system needs to recover memory. They take a low priority, and often take the form of non-essential system processes or, in the case of empty processes, “container” apps whose locations and assets have been cached to speed up re-opening.
Typically, Android is pretty good at figuring out which apps you are using on a regular basis and will retain as best it can the process in RAM. For example, if you’re switching back and forth between an open browser tab and a word processor, the system will keep the browser “visible” in the background so the web page won’t have to reload every time you re-enter the app.
Similarly with apps such as Twitter or Facebook the system will retain your place within the app as if you had just looked away for a moment.
The problem with the One X is that it is closing apps indiscriminately. If I leave Facebook to check an email and re-enter a few minutes later, the app reloads as if the process was killed. This seems to be the case with most applications, though occasionally the screen will “refresh” like Windows Phone but still manage to keep your place within the app.
I have confirmed this to be the case with my personal One X, and it’s not due to malfunctioning hardware. At first I thought it to be a quirk within the software — a way of retaining memory for the visible app — but the more I use the phone the more I see it as a fundamental flaw with the operating system.
HTC claims this is a feature of the operating system and not a bug; it is a way to ensure performance is consistent and the foreground app gets sufficient processing power. For most people this may be the case, as it directly influences battery life for the better. In fact, HTC’s extremely conservative memory management is the reason that the One X seems to be lasting longer than any other Android phone in recent history (combined with the ultra-efficient 28nm Qualcomm SoC). My battery life findings have been hit or miss with the One X, too: on some days it lasts 15-18 hours on a single charge and on others it’s down for the count within 5-8 hours. I suspect this has to do with errant background processes using up precious cycles, something HTC cannot control directly.
More to the point, HTC changed the way that Android manages memory without informing the consumer. At the very least there should be a choice for users to retain the “old” way and risk losing a couple hours of battery in exchange for a more robust multitasking experience. While certain Android apps have been known to abuse the system’s rather liberal implementation of multitasking, I can’t help but think HTC’s solution is akin to putting a bandage on a knife wound. It doesn’t fix Android’s battery issues; rather it places power users at a disadvantage for opening multiple apps.
One of Android’s chief advantages over iOS is (was?) that it supports true multitasking, with apps running in the background unfettered by framework-level API limitations. This appears to be the case here, as HTC has taken to at the very least suspending the state of the background app, forcing it to briefly “resume” before continuing; and at worst closing the app arbitrarily, losing any service-level interaction with the user entirely.
The problem isn’t unique to HTC — previewers of the Samsung Galaxy S III claim similar behaviour some instances — but I can confirm that, compared to the Galaxy Nexus running stock Android 4.0.4, the issue is much more common.
For many users, this memory issue will continue to be perceived as more a bug and less a feature than HTC is intending.