04 November, 2013

Move over, Mavericks: Android 4.4 brings compressed memory to smartphones

We all knew this was coming. Google has supercharged Android with KitKat to make it use resources much better, even on extremely low-end devices with only 512MB of RAM on board. To that end, Google introduced several performance tweaks: less heap used by core processes, aggressive protection of system memory by the kernel and low-level processes, serial (instead of parallel) service startup, the ActivityManager.isLowRamDevice() API,  and, oh, yeah, zRAM, which uses the power of the Linux kernel to make compressed memory on not just desktop computing devices but smartphones a reality.

Compressed memory gained significant notoriety at WWDC 2013, when Apple unveiled iOS 7 and OS X Mavericks. Craig Federighi made a really big deal about memory compression being used in Mavericks, and yeah, Mac users would be able to notice that it makes a big difference when running Mavericks on old Macs. Notably lacking in terms of the performance tweaks, however, was iOS 7. Running iOS 7 on an iPhone 4S (in my case) may at least make it look nice, and of course the removal of skeuomorphism removed much of the software bloat, but the parallax effect tends to stutter and other features made the device lose out on the performance side, particularly because iOS 7 focused so much energy into user interface design that performance tweaks were often overlooked by Apple engineers. Well, even though iPhone users lose out on these performance tweaks, Android users don't.

What's more, in KitKat there's not only compressed memory but also, and if you can believe this, compressed swap space on the storage medium as well. Since smartphones use solid-state storage, and of course fast solid-state storage comparable to the speed of the RAM itself, even virtual memory partitions can become more RAM-like in terms of speed than ever before. Just like the physical RAM, however, the virtual RAM is also capable of being compressed. On my 2-year-old Acer AC700-1099 Chromebook, which of course also uses zRAM along with compressed swap space, it really shows, and most Linux distributions outside of Google are also taking advantage of this awesome power.

Google even has a code name for this aggressive performance tweaking campaign: Project Svelte. As the successor to the notorious Project Butter that has been ongoing since the first release of Jelly Bean (Android 4.1), it is only the start of Google's aggressive campaign to end fragmentation and make Android capable of running easily on low- to mid-range devices as the newest version regardless of what kind of forked home screens or carrier crapware may be installed. This is pretty incredible, and if Apple has anything to learn from this, it's the fact that smartphones are every bit as powerful of computers as desktops and laptops are, and therefore they deserve the same treatment in terms of features, and of making the most out of the hardware, that desktops and laptops do.