The team decoupled Google Apps suite from the system itself, and started analyzing each app's flirt with memory, as some of those are running services in the background 24 hours a day. The software engineers made a tool called ProcStats, which you can see in the Developer options on KitKat phones, that shows exactly how much memory each app and process are consuming over time. The goals were as follows:
- Reduce the footprint of the system.
- Reduce the footprint (memory usage) of the apps that run on a Google Experience (Nexus) device.
- Fix how apps react and crash during bad memory situations.
- Provide better measurement and instrumentation of how apps are running in Android so developers can see how memory-conscious their apps are.
Armed with this knowledge, the team isolated the GApps culprits that were consuming too much memory and didn't need to, optimized their code, and also made Android shut down any apps like those that it deemed unnecessarily thirsty for memory. The fun part was during testing, though, as Dave Burke made each engineer carry a gimped Nexus 4 as a daily driver, which apparently sped up the development of Project Svelte significantly:
The goal of Project Svelte was basically to reduce the memory footprint to fit into 512 megs. The way we did it, by the way ... was to take a Nexus 4 and adapt it to run at 512 megs.
The next step was to get KitKat running at a lower resolution and on two processors instead of four. The clock frequency was lowered. To make sure Android engineers were eating their own dog food, they all started using these slimmed down Nexus 4s to get a closer experience of what they were making.
We adapted the resolution to qHD that is 960-by-540 because that is kind of the sweet spot for entry level smartphones. We reduced it from four CPUs to two CPUs. We reduced the clock frequency and whatnot. And literally a bunch of us just used that as our default phone. It was painful and it was broken to start with.
This way, isolating the bad memory situations and reducing the system and Google Apps footprint, the Android engineering team managed to make a giant step towards reducing fragmentation. Even low-end white box Chinese handsets, which very often ship with Gingerbread even, can now ship with the latest version of Android without their makers worrying about the phone's performance.