When the iPhone 6 and iPhone 6 Plus were announced, many Android fans laughed at the “pitiful” 1GB of RAM of Apple’s flagship smartphone, when Android flagships tended to ship with 2GB and sometimes more.
But specs don’t always — or even most of the time — tell the whole story. As it turns out, an iPhone 6 with 1GB of RAM runs much faster than a similarly specced Android smartphone with 2GB of RAM. And it all has to do with the fundamental difference in the way iOS and Android handle apps.
According to Glyn Williams over on Quora, iOS devices run better than Android devices with twice the RAM because Android apps use Java, and need all the extra RAM to do something called garbage collection.
What’s garbage collection? It’s a process that triggers the recycling of memory once an Android app is done using it. Usually, this works pretty well on systems that have a lot of free RAM, but once you get a lot of different apps running, things start getting dicey.
According to Williams, Android’s garbage collectors work best when Android apps have 4 to 8 times as much memory as is actually needed in order to perform the garbage collection process. Once you stop having that amount of free memory available, performance starts suffering.
This is why Android devices need to have twice as much RAM to run apps as your iPhone does. And as we’ve previously seen, more RAM negatively affects battery life too, which is part of why Android phones need to have larger batteries to attain the same battery life as an iPhone 6 too.
As for iOS? The operating system doesn’t need all the extra memory associated with Java and Android, since it was designed to avoid this sort of garbage collection from scratch. It only needs the memory it’s using. What a radical idea, huh?