Android 5.0 Lollipop's Memory Leak: To Be Fixed In A Future Release

Android Lollipop Banner

I’ll start my article with an experiment. All you have to do is open a webpage on an current iPhone (if you’re a true Android fan, ignore the burning sensation, it’ll pass) and whilst it’s still rendering the site, attempt to scroll up and down on it. You’ll notice that the device scrolling is beautifully smooth but that the web page doesn’t render under your finger. It’s paused until you let go, then it’ll continue where it left off. Now try the same activity on an Android device – any Android device, it doesn’t matter – and you’ll likely notice that the scrolling is probably not quite as smooth (although it might be, depending on the device) but the page will continue to render. What’s better depends on one, if you notice this and two, see point one. There’s no right or wrong answer, but it illustrates one of the key differences between iOS and Android. iOS puts user input as a real time process, which means it stops almost everything else when your finger is on the screen. It makes for a smooth user interface but can use other applications and tasks to take their time. There are other core differences between the two operating systems, too, especially when it comes to dealing with background tasks. Android has always handled stuff in the background whereas iOS has only relatively recently supported multitasking. It’s meant that Android is a “heavier” operating system with greater need for resources compared with iOS; the processor in the Android device is worked harder and it needs more memory. This is precisely why one cannot berate a dual core, 512 MB iPhone as being underpowered compared with a quad core, 3 GB memory. If anything, Android is inefficient compared with iOS, but I digress.

Android splits its processor time up between everything running, which means it can make a bit of a mess of certain activities and processes. Each process requires an element of processor time and memory; our devices are remarkably efficient when it comes to handling memory. I’d recommend not falling into the trap of wanting to keep as much RAM free as possible, because Android is built on LINUX, which treats memory as a resource to be used. Free memory is a wasted resource, but it’s easily possible to want more. And this is why older devices running current applications can struggle: newer applications are greedier with their memory footprint and the device starts spending more and more time shuffling memory around rather than doing something useful. With the current version of Android, that being 5.0.x Lollipop, some users are reporting that after around forty hours of uptime the device starts struggling to perform. Applications hang and close. Things get sluggish. Those beautiful animations jerk and stutter. A reboot solves things, but as users are not used to a device that feels like Windows 95 and instead we like our devices to keep on running smoothly. I’m pleased to write that users have been submitting bug reports to the Android Open Source Project Issue Tracker: Google needs to know about these issues.

To all intents and purposes, the issue appears to have been nailed down by Google as a memory leak. Memory leaks are more commonplace in modern operating systems than users would like; this is one reason why over a period of time, devices slow down. They accumulate junk, either in the file system, in memory or more likely, both. It can happen in one of several ways. One way is that when the user launches an application, it requires a given amount of memory. It occupies this memory, but what happens when we finish with the application? If the user closes it and it doesn’t leave anything running, it ought to release all of that memory back to the operating system. If it does, great. If it does not, okay that takes up a little space. Some applications are buggy and sometimes the operating system does not reclaim all of the released space to reallocate it to other applications. Other applications leave a part resident for dealing with notifications and similar. Over a period of time the amount of available memory gradually shrinks. Then you try to launch a particularly greedy application and it crashes or hangs, which typically makes the situation worse.

It seems that current versions of Android have a memory leak, that the operating system is less efficient when it comes to releasing memory for other applications. That’s bad news but it does appear that Google have identified the bug and it’s been marked as released. The fix is showing “FutureRelease,” in other words, a subsequent release of Android will solve this issue. This means that those manufacturers still working on a release of Android Lollipop for their portfolio of devices have the opportunity to include the fixed code and this is good news. What we don’t know, however, is when this fix will be released. Hopefully, it’ll be soon.